diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /third_party/rust/jsparagus/.github/workflows | |
parent | Initial commit. (diff) | |
download | firefox-esr-upstream.tar.xz firefox-esr-upstream.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/rust/jsparagus/.github/workflows')
7 files changed, 447 insertions, 0 deletions
diff --git a/third_party/rust/jsparagus/.github/workflows/ci-daily.yml b/third_party/rust/jsparagus/.github/workflows/ci-daily.yml new file mode 100644 index 0000000000..37a258b28d --- /dev/null +++ b/third_party/rust/jsparagus/.github/workflows/ci-daily.yml @@ -0,0 +1,46 @@ +name: CI Daily + +on: + schedule: + # Run daily at 00:00 + - cron: '0 0 * * 0-6' + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - name: Setup Python + uses: actions/setup-python@v1 + with: + python-version: "3.7" + - uses: actions/checkout@v2 + with: + ref: ci_results + - name: Get Fuzzbugs + run: | + cd .metrics + # Only update this if it doesn't already exist. + # This action is only used to calculate the days since the last fuzzbug. + if [ ! -f count/fuzzbug.json ]; then + curl "https://api.github.com/repos/mozilla-spidermonkey/jsparagus/issues?labels=libFuzzer&state=all" > count/fuzzbug.json + fi + python fuzzbug_date_badge.py + git add badges/since-last-fuzzbug.json + git add count/fuzzbug.json + - name: Commit files + # fails if no files to commit + continue-on-error: true + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git commit -m "update NotImplemented Count" -a + - name: Push changes + # fails if no files to commit + continue-on-error: true + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: ci_results + force: true diff --git a/third_party/rust/jsparagus/.github/workflows/ci-generated.yml b/third_party/rust/jsparagus/.github/workflows/ci-generated.yml new file mode 100644 index 0000000000..4027c6c9c6 --- /dev/null +++ b/third_party/rust/jsparagus/.github/workflows/ci-generated.yml @@ -0,0 +1,54 @@ +name: Generate Files + +on: + push: + branches: + - master + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # otherwise, you will failed to push refs to dest repo + - name: Setup Python + uses: actions/setup-python@v1 + with: + python-version: "3.7" + - name: Setup Git Profile + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + - name: Revert Previous Change and Merge Master + run: | + if git ls-remote origin | grep refs/heads/ci_generated; then + # If the remote branch exists. + git fetch origin + + # Merge master, discarding changes in origin/ci_generated + MASTER_REV=$(git log -1 master --pretty=%H) + git checkout -b ci_generated-master origin/master + git merge origin/ci_generated -m "Merge master ${MASTER_REV}" -s ours --allow-unrelated-histories + else + # Otherwise, just start from master branch. + git checkout -b ci_generated-master + fi + - name: Generate Files + run: | + make init-venv && make all + # OS independant replace + sed -i.bak '/*_generated.rs/d' .gitignore && rm .gitignore.bak + - name: Commit files + run: | + git add . + MASTER_REV=$(git log -1 master --pretty=%H) + git commit -m "Add Generated Files for ${MASTER_REV}" -a + - name: Push changes + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: ci_generated + diff --git a/third_party/rust/jsparagus/.github/workflows/ci-issues.yml b/third_party/rust/jsparagus/.github/workflows/ci-issues.yml new file mode 100644 index 0000000000..bb2265ecb3 --- /dev/null +++ b/third_party/rust/jsparagus/.github/workflows/ci-issues.yml @@ -0,0 +1,44 @@ +name: CI Issues + +on: + issues: + types: [opened, closed, reopened] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - name: Setup Python + uses: actions/setup-python@v1 + with: + python-version: "3.7" + - uses: actions/checkout@v2 + with: + ref: ci_results + - name: Count Fuzzbugs + run: | + cd .metrics + # Get the new list + curl "https://api.github.com/repos/mozilla-spidermonkey/jsparagus/issues?labels=libFuzzer&state=all" > count/fuzzbug.json + python fuzzbug_count_badge.py + python fuzzbug_date_badge.py + git add badges/since-last-fuzzbug.json + git add badges/open-fuzzbug.json + git add count/fuzzbug.json + - name: Commit files + # fails if no files to commit + continue-on-error: true + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git commit -m "update NotImplemented Count" -a + - name: Push changes + # fails if no files to commit + continue-on-error: true + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: ci_results + force: true diff --git a/third_party/rust/jsparagus/.github/workflows/ci-push.yml b/third_party/rust/jsparagus/.github/workflows/ci-push.yml new file mode 100644 index 0000000000..0ca6f3a954 --- /dev/null +++ b/third_party/rust/jsparagus/.github/workflows/ci-push.yml @@ -0,0 +1,57 @@ +name: NotImplemented + +on: + push: + branches: + - master + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + # Check out master, so that we can count. + - uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v1 + with: + python-version: "3.7" + - name: Get Count + # Record the count in a tmp file so it survives changing branches + run: | + find crates -iname '*.rs' -type f -exec cat {} + | grep -c -E "(Emit|Parse)Error::NotImplemented" > /tmp/count + git rev-parse HEAD > /tmp/commit + cp .metrics/not_implemented_badge.py /tmp + cp .metrics/not_implemented_count.py /tmp + # Checkout the results branch + - uses: actions/checkout@v2 + with: + ref: ci_results + - name: Add NotImplemented count + run: | + export total_count=$(cat /tmp/count) + export current_commit=$(cat /tmp/commit) + # Make sure the generating files are up to date + cp -f /tmp/not_implemented_badge.py .metrics/not_implemented_badge.py + cp -f /tmp/not_implemented_count.py .metrics/not_implemented_count.py + # Run the files + cd .metrics + python not_implemented_badge.py + python not_implemented_count.py + git add badges/not-implemented.json + git add count/not-implemented.json + - name: Commit files + # fails if no files to commit + continue-on-error: true + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git commit -m "update NotImplemented Count" -a + - name: Push changes + uses: ad-m/github-push-action@master + continue-on-error: true + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: ci_results + force: true diff --git a/third_party/rust/jsparagus/.github/workflows/real-js-benchmark.yml b/third_party/rust/jsparagus/.github/workflows/real-js-benchmark.yml new file mode 100644 index 0000000000..eec8047762 --- /dev/null +++ b/third_party/rust/jsparagus/.github/workflows/real-js-benchmark.yml @@ -0,0 +1,135 @@ +name: Real JS Samples Benchmark +on: + pull_request: + types: [opened, synchronize, reopened] + push: + branches: + - master + +jobs: + benchmark: + # This workflow relies on: + # - A specific hardware (benchmark-pool-1) in order to have a consistent + # and comparable results against multiple builds. + # + # - Some persistent data to reduce the time needed to checkout + # mozilla-central. + # + # To setup such host multiple things should be considered. + # + # In terms of security, the code which is executed on this hardware should + # not be trusted. As such, the Github Action jobs should run on a dedicated + # computer which is either isolated or containerized. Do not run this setup + # on a non-dedicated computer! + # + # It is best to create a dedicated user. + # $ mkdir /var/github-action-runner + # $ useradd -d /var/github-action-runner github-action-user + # + # Make sure this newly added user has no sudo capabilities. + # + # A checkout of Gecko should be present under /var/github-action-runner. The + # dependencies for building Gecko should as well be installed with `mach + # bootstrap`, which can be done using another user with sudo capabilities, + # and changing the HOME environment variable to match the github-action-user + # home. + # + # The file /var/github-action-runner/.profile contains: + # + # export PATH="$HOME/.cargo/bin:$PATH" + # export PATH="/var/github-action-runner/.mozbuild/git-cinnabar:$PATH" + # + # Which is used to add cargo in the path, as well as git-cinnabar, to keep + # the gecko clone up to date. + # + # To add this computer to the benchmark pool, follow the instruction + # provided by github, after clicking "Add runner" on this page: + # https://github.com/mozilla-spidermonkey/jsparagus/settings/actions + # + # "benchmark-pool-1" specification: + # /proc/cpuinfo: + # Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz + # dmidecode --type 17: + # 2x Hynix/Hyundai HMT41GU6MFR8C-PB (DDR3, 8GB, 1600 MT/s) + # + runs-on: [self-hosted, benchmark-pool-1] + steps: + - name: Clean Work Directory + run: | + rm -rf * + - name: Checkout jsparagus + uses: actions/checkout@v2 + with: + fetch-depth: 0 + path: 'jsparagus' + - name: Checkout real-js-samples + uses: actions/checkout@v2 + with: + repository: 'Yoric/real-js-samples' + path: 'real-js-samples' + fetch-depth: 0 + - name: Checkout mozilla-central + run: | + # Pull mozilla-central changes + source /var/github-action-runner/.profile + git -C /var/github-action-runner/gecko pull --all + # Create a local clone of mozilla-central + git clone -l /var/github-action-runner/gecko mozilla-central + - name: Status of Checkouts + run: | + echo "mozilla-central: $(git -C mozilla-central show --oneline -s)" + echo "jsparagus: $(git -C jsparagus show --oneline -s)" + echo "real-js-samples: $(git -C real-js-samples show --oneline -s)" + - name: Setup venv + run: | + source /var/github-action-runner/.profile + cd jsparagus + make init + - name: Generate Files + run: | + source /var/github-action-runner/.profile + cd jsparagus + make all + # OS independant replace + sed -i.bak '/*_generated.rs/d' .gitignore && rm .gitignore.bak + - name: Apply gecko patches + run: | + source /var/github-action-runner/.profile + cd mozilla-central + cat ../jsparagus/gecko-patches.txt | while read PATCH_AND_BUG; do + PATCH=$(echo $PATCH_AND_BUG | cut -d : -f 1) + BUG=$(echo $PATCH_AND_BUG | cut -d : -f 2) + + # Check bug status and skip if it's already landed. + STATUS=$(curl https://bugzilla.mozilla.org/rest/bug/$BUG | python3 -c 'import sys, json; print(json.load(sys.stdin)["bugs"][0]["status"])') + echo "Bug $BUG $STATUS" + if [ "x$STATUS" = "xRESOLVED" ]; then + continue + fi + + # Apply the latest patch from phabricator. + PATCH_URL=https://phabricator.services.mozilla.com/${PATCH}?download=true + curl --location "$PATCH_URL" | git apply --index || git reset --hard + git status + git commit --allow-empty -m "Bug $BUG" + done + - name: Build Gecko + run: | + # Disable Opcodes.h check, as we only focus on parsing speed. + export JS_SMOOSH_DISABLE_OPCODE_CHECK=1 + # Apply Bug 1640982 fix. + export CARGO_PROFILE_RELEASE_LTO=true + source /var/github-action-runner/.profile + cd jsparagus + cargo run --bin smoosh_tools build --opt + - name: Benchmark Real JS Samples + run: | + source /var/github-action-runner/.profile + cd jsparagus + cargo run --bin smoosh_tools bench --opt + - name: Post Checkout mozilla-central + if: ${{ always() }} + run: | + # Remove checked out repository. + rm -rf mozilla-central + diff --git a/third_party/rust/jsparagus/.github/workflows/rust.yml b/third_party/rust/jsparagus/.github/workflows/rust.yml new file mode 100644 index 0000000000..3ecc7db649 --- /dev/null +++ b/third_party/rust/jsparagus/.github/workflows/rust.yml @@ -0,0 +1,24 @@ +name: Rust + +on: + pull_request: + types: [opened, synchronize, reopened] + push: + branches: + - master + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: Setup Python + uses: actions/setup-python@v1 + with: + python-version: "3.7" + - name: Initialize repository + run: make init + - name: Build & Test + run: RUSTFLAGS="-D warnings" make check diff --git a/third_party/rust/jsparagus/.github/workflows/smoosh-status.yml b/third_party/rust/jsparagus/.github/workflows/smoosh-status.yml new file mode 100644 index 0000000000..b68925dd7f --- /dev/null +++ b/third_party/rust/jsparagus/.github/workflows/smoosh-status.yml @@ -0,0 +1,87 @@ +name: SmooshMonkey status + +on: + schedule: + # Every hour + - cron: '0 * * * *' + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v1 + with: + python-version: "3.7" + - name: Initialize venv + run: make init-venv + - name: Setup Git Profile + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + - name: Check SmooshMonkey status + run: make smoosh-status-ci + id: status + - name: Checkout ci_smoosh_status + run: | + if git ls-remote origin | grep refs/heads/ci_smoosh_status; then + # If the remote branch exists. + git fetch origin ci_smoosh_status + git checkout -b ci_smoosh_status origin/ci_smoosh_status + else + # Otherwise, create a branch. + git checkout -b ci_smoosh_status-master + # And reset all history + git reset --hard deb48a2460abf091705d9972318bbb6e7349de9c + # And also remove remaining files + rm README.md gen.py + echo jsparagus_build_venv > .gitignore + fi + - name: Update files + run: | + echo ${{steps.status.outputs.mc}} > latest_mc + echo ${{steps.status.outputs.jsparagus}} > latest_jsparagus + echo ${{steps.status.outputs.build}} > latest_build + echo ${{steps.status.outputs.test}} > latest_test + + if [ ${{steps.status.outputs.build}} == "OK" ]; then + BUILD_COLOR="green" + elif [ ${{steps.status.outputs.build}} == "NG" ]; then + BUILD_COLOR="red" + else + BUILD_COLOR="yellow" + fi + + if [ ${{steps.status.outputs.test}} == "OK" ]; then + echo ${{steps.status.outputs.mc}} > known_good_mc + echo ${{steps.status.outputs.jsparagus}} > known_good_jsparagus + TEST_COLOR="green" + elif [ ${{steps.status.outputs.test}} == "NG" ]; then + TEST_COLOR="red" + else + TEST_COLOR="yellow" + fi + + echo "{ \"schemaVersion\": 1, \"label\": \"SmooshMonkey Build\", \"message\": \"${{steps.status.outputs.build}}\", \"color\": \"$BUILD_COLOR\" }" > smoosh_build.json + echo "{ \"schemaVersion\": 1, \"label\": \"SmooshMonkey Test\", \"message\": \"${{steps.status.outputs.test}}\", \"color\": \"$TEST_COLOR\" }" > smoosh_test.json + - name: Add files + run: | + git add . + set +e + git diff --cached --quiet + echo "##[set-output name=modified;]$?" + set -e + id: status_add + - name: Commit files + if: steps.status_add.outputs.modified == '1' + run: | + git commit -m "Update Smoosh Status" -a + - name: Push changes + if: steps.status_add.outputs.modified == '1' + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: ci_smoosh_status |