From e754df35f5b42231ac622190b7894c34fc167eb3 Mon Sep 17 00:00:00 2001 From: Jason Williams <936006+jasonwilliams@users.noreply.github.com> Date: Sun, 31 Mar 2024 14:41:53 +0100 Subject: [PATCH] don't run test262 on push (#3774) * don't run test262 on push anymore * wrap in an expression * remove writing to the gh-pages branch * checkout data repo for comparison * check dirs * add back in PR checks --- .github/workflows/test262.yml | 40 +++++------------------------------ tests/tester/src/results.rs | 30 -------------------------- 2 files changed, 5 insertions(+), 65 deletions(-) diff --git a/.github/workflows/test262.yml b/.github/workflows/test262.yml index 0b2ab48875a..d51beb91e08 100644 --- a/.github/workflows/test262.yml +++ b/.github/workflows/test262.yml @@ -1,10 +1,5 @@ name: EcmaScript official test suite (test262) on: - push: - branches: - - main - tags: - - v* pull_request: branches: - main @@ -37,13 +32,12 @@ jobs: ~/.cargo/registry key: ${{ runner.os }}-cargo-test262-${{ hashFiles('**/Cargo.lock') }} - - name: Checkout GitHub pages + - name: Checkout the data repo uses: actions/checkout@v4 with: - ref: gh-pages - path: gh-pages - - # Run the test suite. + repository: boa-dev/data + path: data + # Run the test suite. - name: Run the test262 test suite run: | cd boa @@ -58,7 +52,7 @@ jobs: shell: bash run: | cd boa - comment="$(./target/release/boa_tester compare ../gh-pages/test262/refs/heads/main/latest.json ../results/test262/pull/latest.json -m)" + comment="$(./target/release/boa_tester compare ../data/test262/refs/heads/main/latest.json ../results/test262/pull/latest.json -m)" echo "comment<> $GITHUB_OUTPUT echo "$comment" >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT @@ -99,27 +93,3 @@ jobs: ${{ steps.compare.outputs.comment }} - # Commit changes to GitHub pages. - - name: Checkout GitHub pages - if: github.event_name == 'push' - uses: actions/checkout@v4 - with: - ref: gh-pages - path: gh-pages - - name: Commit files - if: github.event_name == 'push' - run: | - cp -r ./results/test262/* ./gh-pages/test262/ - cd gh-pages - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - git add test262 - git commit -m "Add new test262 results" -a - cd .. - - name: Upload results - if: github.event_name == 'push' - uses: ad-m/github-push-action@v0.8.0 - with: - directory: gh-pages - branch: gh-pages - github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/tests/tester/src/results.rs b/tests/tester/src/results.rs index 12600d1ca17..2825d08cd23 100644 --- a/tests/tester/src/results.rs +++ b/tests/tester/src/results.rs @@ -100,9 +100,6 @@ pub(crate) fn write_json( folder }; - // We make sure we are using the latest commit information in GitHub pages: - update_gh_pages_repo(output_dir.as_path(), verbose); - if verbose != 0 { println!("Writing the results to {}...", output_dir.display()); } @@ -170,33 +167,6 @@ fn get_test262_commit(test262_path: &Path) -> Result> { Ok(commit_id.into_boxed_str()) } -/// Updates the GitHub pages repository by pulling latest changes before writing the new things. -fn update_gh_pages_repo(path: &Path, verbose: u8) { - if env::var("GITHUB_REF").is_ok() { - use std::process::Command; - - // We run the command to pull the gh-pages branch: git -C ../gh-pages/ pull origin - Command::new("git") - .args(["-C", "../gh-pages", "pull", "--ff-only"]) - .output() - .expect("could not update GitHub Pages"); - - // Copy the full results file - let from = Path::new("../gh-pages/test262/refs/heads/main/").join(RESULTS_FILE_NAME); - let to = path.join(RESULTS_FILE_NAME); - - if verbose != 0 { - println!( - "Copying the {} file to {} in order to add the results", - from.display(), - to.display() - ); - } - - fs::copy(from, to).expect("could not copy the main results file"); - } -} - /// Compares the results of two test suite runs. #[allow(clippy::cast_possible_wrap)] pub(crate) fn compare_results(base: &Path, new: &Path, markdown: bool) -> Result<()> {