Browse Source

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
pull/3775/head
Jason Williams 8 months ago committed by GitHub
parent
commit
e754df35f5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 40
      .github/workflows/test262.yml
  2. 30
      tests/tester/src/results.rs

40
.github/workflows/test262.yml

@ -1,10 +1,5 @@
name: EcmaScript official test suite (test262) name: EcmaScript official test suite (test262)
on: on:
push:
branches:
- main
tags:
- v*
pull_request: pull_request:
branches: branches:
- main - main
@ -37,13 +32,12 @@ jobs:
~/.cargo/registry ~/.cargo/registry
key: ${{ runner.os }}-cargo-test262-${{ hashFiles('**/Cargo.lock') }} key: ${{ runner.os }}-cargo-test262-${{ hashFiles('**/Cargo.lock') }}
- name: Checkout GitHub pages - name: Checkout the data repo
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
ref: gh-pages repository: boa-dev/data
path: gh-pages path: data
# Run the test suite.
# Run the test suite.
- name: Run the test262 test suite - name: Run the test262 test suite
run: | run: |
cd boa cd boa
@ -58,7 +52,7 @@ jobs:
shell: bash shell: bash
run: | run: |
cd boa 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<<EOF" >> $GITHUB_OUTPUT echo "comment<<EOF" >> $GITHUB_OUTPUT
echo "$comment" >> $GITHUB_OUTPUT echo "$comment" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT
@ -99,27 +93,3 @@ jobs:
${{ steps.compare.outputs.comment }} ${{ 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 }}

30
tests/tester/src/results.rs

@ -100,9 +100,6 @@ pub(crate) fn write_json(
folder 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 { if verbose != 0 {
println!("Writing the results to {}...", output_dir.display()); println!("Writing the results to {}...", output_dir.display());
} }
@ -170,33 +167,6 @@ fn get_test262_commit(test262_path: &Path) -> Result<Box<str>> {
Ok(commit_id.into_boxed_str()) 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. /// Compares the results of two test suite runs.
#[allow(clippy::cast_possible_wrap)] #[allow(clippy::cast_possible_wrap)]
pub(crate) fn compare_results(base: &Path, new: &Path, markdown: bool) -> Result<()> { pub(crate) fn compare_results(base: &Path, new: &Path, markdown: bool) -> Result<()> {

Loading…
Cancel
Save