Skip to content

Commit

Permalink
don't run test262 on push (#3774)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
jasonwilliams authored Mar 31, 2024
1 parent 08b0deb commit e754df3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 65 deletions.
40 changes: 5 additions & 35 deletions .github/workflows/test262.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
name: EcmaScript official test suite (test262)
on:
push:
branches:
- main
tags:
- v*
pull_request:
branches:
- main
Expand Down Expand Up @@ -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
Expand All @@ -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<<EOF" >> $GITHUB_OUTPUT
echo "$comment" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -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 "[email protected]"
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/[email protected]
with:
directory: gh-pages
branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
30 changes: 0 additions & 30 deletions tests/tester/src/results.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down Expand Up @@ -170,33 +167,6 @@ fn get_test262_commit(test262_path: &Path) -> Result<Box<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.
#[allow(clippy::cast_possible_wrap)]
pub(crate) fn compare_results(base: &Path, new: &Path, markdown: bool) -> Result<()> {
Expand Down

0 comments on commit e754df3

Please sign in to comment.