Skip to content

Commit

Permalink
ci: update workflow deps and cancel jobs on PR update
Browse files Browse the repository at this point in the history
  • Loading branch information
Conaclos committed Sep 12, 2023
1 parent 4a024bb commit d1a754d
Show file tree
Hide file tree
Showing 14 changed files with 102 additions and 123 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/bench_analyzer.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Parser benchmark, compares main and PR branch with Criterion.
# Comment with text containing `!bench`, a new result will be commented at the bottom of this PR.
# Analyzer benchmark, compares main and PR branch with Criterion.
# Comment with text containing `!bench_analyzer`, a new result will be commented at the bottom of this PR.

name: Analyzer Benchmark

Expand Down Expand Up @@ -29,13 +29,12 @@ jobs:
return response.data.head.sha;
- name: Checkout PR Branch
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: false
ref: ${{ steps.sha.outputs.result }}

- name: Install toolchain
uses: moonrepo/setup-rust@v0
uses: moonrepo/setup-rust@v1

- name: Install critcmp
run: cargo install critcmp
Expand All @@ -47,7 +46,7 @@ jobs:
run: cargo bench_analyzer --save-baseline pr

- name: Checkout Main Branch
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
clean: false
ref: main
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/bench_cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,12 @@ jobs:
return response.data.head.sha;
- name: Checkout PR Branch
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: false
ref: ${{ steps.sha.outputs.result }}

- name: Install toolchain
uses: moonrepo/setup-rust@v0
uses: moonrepo/setup-rust@v1

- name: Install hyperfine
run: cargo install hyperfine
Expand All @@ -47,7 +46,7 @@ jobs:
cp target/release/biome benchmark/target/biome_pr
- name: Checkout Main Branch
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
clean: false
ref: main
Expand All @@ -58,17 +57,17 @@ jobs:
cp target/release/biome benchmark/target/biome_main
- name: Checkout webpack
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: webpack/webpack
path: benchmark/target/webpack
- name: Checkout prettier
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: prettier/prettier
path: benchmark/target/prettier
- name: Checkout eslint
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: eslint/eslint
path: benchmark/target/eslint
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/bench_formatter.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Parser benchmark, compares main and PR branch with Criterion.
# Comment with text containing `!bench`, a new result will be commented at the bottom of this PR.
# Formatter benchmark, compares main and PR branch with Criterion.
# Comment with text containing `!bench_formatter`, a new result will be commented at the bottom of this PR.

name: Formatter Benchmark

Expand Down Expand Up @@ -29,13 +29,12 @@ jobs:
return response.data.head.sha;
- name: Checkout PR Branch
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: false
ref: ${{ steps.sha.outputs.result }}

- name: Install toolchain
uses: moonrepo/setup-rust@v0
uses: moonrepo/setup-rust@v1

- name: Install critcmp
run: cargo install critcmp
Expand All @@ -47,7 +46,7 @@ jobs:
run: cargo bench_formatter --save-baseline pr

- name: Checkout Main Branch
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
clean: false
ref: main
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/bench_parser.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Parser benchmark, compares main and PR branch with Criterion.
# Comment with text containing `!bench`, a new result will be commented at the bottom of this PR.
# Comment with text containing `!bench_parser`, a new result will be commented at the bottom of this PR.

name: Parser Benchmark

Expand Down Expand Up @@ -28,13 +28,12 @@ jobs:
const response = await github.request(context.payload.issue.pull_request.url);
return response.data.head.sha;
- name: Checkout PR Branch
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: false
ref: ${{ steps.sha.outputs.result }}

- name: Install toolchain
uses: moonrepo/setup-rust@v0
uses: moonrepo/setup-rust@v1

- name: Install critcmp
run: cargo install critcmp
Expand All @@ -46,7 +45,7 @@ jobs:
run: cargo bench_parser --save-baseline pr

- name: Checkout Main Branch
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
clean: false
ref: main
Expand Down
38 changes: 15 additions & 23 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,14 @@ jobs:
name: Format Rust Files
runs-on: ubuntu-latest
steps:
- name: Checkout PR Branch
uses: actions/checkout@v3
with:
submodules: false
- name: Checkout repository
uses: actions/checkout@v4
- name: Support longpaths
run: git config core.longpaths true
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install toolchain
uses: moonrepo/setup-rust@v0
uses: moonrepo/setup-rust@v1
with:
components: rustfmt
bins: taplo-cli
Expand All @@ -42,9 +40,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install toolchain
uses: moonrepo/setup-rust@v0
uses: moonrepo/setup-rust@v1
with:
components: clippy
- name: Run cargo check
Expand All @@ -56,35 +54,31 @@ jobs:
name: Check Dependencies
runs-on: ubuntu-latest
steps:
- name: Checkout PR Branch
uses: actions/checkout@v3
with:
submodules: false
- name: Checkout repository
uses: actions/checkout@v4
- name: Install toolchain
uses: moonrepo/setup-rust@v0
uses: moonrepo/setup-rust@v1
with:
channel: nightly
- name: Install udeps
run: cargo install cargo-udeps --locked
- name: Run udeps
run: cargo +nightly udeps


test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: windows-latest
- os: ubuntu-latest
- os: macos-latest

name: Test
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install toolchain
uses: moonrepo/setup-rust@v0
uses: moonrepo/setup-rust@v1
with:
bins: cargo-nextest
- name: Run tests on ${{ matrix.os }}
Expand All @@ -95,23 +89,21 @@ jobs:
coverage:
name: Test262 Coverage
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest]

steps:
# ref: https://github.com/orgs/community/discussions/26952
- name: Support longpaths
if: matrix.os == 'windows-latest'
run: git config --system core.longpaths true
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install toolchain
uses: moonrepo/setup-rust@v0
uses: moonrepo/setup-rust@v1
- name: Compile
run: cargo build --release --locked -p xtask_coverage
- name: Run Test262 suite
Expand Down
18 changes: 5 additions & 13 deletions .github/workflows/parser_conformance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,22 @@ jobs:
permissions:
pull-requests: write
name: Parser conformance
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
runs-on: ubuntu-latest

steps:
- name: Checkout PR Branch
uses: actions/checkout@v3
with:
submodules: false
uses: actions/checkout@v4

- name: Support longpaths
run: git config core.longpaths true

- name: Checkout PR Branch
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install toolchain
uses: moonrepo/setup-rust@v0
uses: moonrepo/setup-rust@v1

- name: Compile
run: cargo build --release --locked -p xtask_coverage
Expand All @@ -53,7 +46,7 @@ jobs:
run: cargo coverage --json > new_results.json

- name: Checkout main Branch
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
clean: false
ref: main
Expand All @@ -75,7 +68,6 @@ jobs:
cat output >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Get the PR number
if: github.event_name == 'pull_request'
id: pr-number
Expand Down
Loading

0 comments on commit d1a754d

Please sign in to comment.