Skip to content

Commit

Permalink
fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
ForsakenHarmony committed Jul 29, 2024
1 parent b9640d1 commit f9f623b
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ permissions:
contents: read
pull-requests: read

env:
NODE_LTS_VERSION: 20

jobs:
determine_jobs:
name: Determine jobs to run
Expand All @@ -27,8 +30,8 @@ jobs:
uses: peter-evans/find-comment@v2
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: "github-actions[bot]"
body-includes: "<!-- CI TURBOPACK BENCH COMMENT -->"
comment-author: 'github-actions[bot]'
body-includes: '<!-- CI TURBOPACK BENCH COMMENT -->'

- name: Create or update PR comment
if: github.event_name == 'pull_request' && steps.comment.outputs.comment-id != ''
Expand Down Expand Up @@ -124,10 +127,10 @@ jobs:
needs.determine_jobs.outputs.cargo_only == 'true'
name: Turbopack rust check
runs-on:
- "self-hosted"
- "linux"
- "x64"
- "metal"
- 'self-hosted'
- 'linux'
- 'x64'
- 'metal'

steps:
- name: Checkout
Expand All @@ -136,13 +139,11 @@ jobs:
- name: Setup Rust
uses: ./.github/actions/setup-rust
with:
components: clippy
targets: wasm32-unknown-unknown
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Run cargo check release
run: |
RUSTFLAGS="-D warnings -A deprecated" cargo groups check turbopack --features rustls-tls --release
RUSTFLAGS="-D warnings -A deprecated" cargo check --features rustls-tls --release
turbopack_rust_bench:
needs: [determine_jobs, turbopack_rust_check]
Expand Down Expand Up @@ -184,26 +185,26 @@ jobs:
TURBOPACK_BENCH_COUNTS: 1000,10000

runs-on:
- "self-hosted"
- "linux"
- "x64"
- "metal"
- 'self-hosted'
- 'linux'
- 'x64'
- 'metal'

name: Benchmark on ${{ matrix.bench.name }}

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Node.js
uses: ./.github/actions/setup-node
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_LTS_VERSION }}
check-latest: true
- run: corepack enable

- name: Setup Rust
uses: ./.github/actions/setup-rust
with:
shared-cache-key: benchmark-${{ matrix.bench.cache_key }}
save-cache: true
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Clear benchmarks
run: rm -rf target/criterion
Expand Down Expand Up @@ -320,10 +321,10 @@ jobs:
title: Linux
quiet: false
runs-on:
- "self-hosted"
- "linux"
- "x64"
- "metal"
- 'self-hosted'
- 'linux'
- 'x64'
- 'metal'
# - name: macos
# title: MacOS
# quiet: true
Expand All @@ -349,9 +350,6 @@ jobs:

- name: Setup Rust
uses: ./.github/actions/setup-rust
with:
shared-cache-key: benchmark-${{ matrix.os.name }}
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Benchmark and compare with base branch
uses: sokra/criterion-compare-action@main
Expand Down Expand Up @@ -430,8 +428,8 @@ jobs:
uses: peter-evans/find-comment@v2
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: "github-actions[bot]"
body-includes: "<!-- CI TURBOPACK BENCH COMMENT -->"
comment-author: 'github-actions[bot]'
body-includes: '<!-- CI TURBOPACK BENCH COMMENT -->'

- name: Create or update PR comment
if: always() && github.event_name == 'pull_request' && steps.info.outputs.cancelled != 'true'
Expand All @@ -440,7 +438,7 @@ jobs:
with:
comment-id: ${{ steps.comment.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body-file: "comment.md"
body-file: 'comment.md'
edit-mode: replace

- name: It's not fine
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,14 @@ jobs:
stepName: 'test-cargo-unit'
secrets: inherit

test-bench:
name: test cargo benches
needs: ['changes', 'build-next']
if: ${{ needs.changes.outputs.docs-only == 'false' }}

uses: ./.github/workflows/test-turbopack-rust-bench-test.yml
secrets: inherit

rust-check:
name: rust check
needs: ['changes', 'build-next']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ on:
type: boolean

env:
TURBOPACK_BENCH_COUNTS: "100"
TURBOPACK_BENCH_PROGRESS: "1"
TURBOPACK_BENCH_COUNTS: '100'
TURBOPACK_BENCH_PROGRESS: '1'

NODE_LTS_VERSION: 20

jobs:
test:
Expand All @@ -30,11 +32,13 @@ jobs:

- name: Setup Rust
uses: ./.github/actions/setup-rust
env:
GITHUB_TOKEN: ${{ github.token }}

- name: Setup node
uses: actions/setup-node@v4
with:
save-cache: true
github-token: "${{ secrets.GITHUB_TOKEN }}"
node-version: ${{ env.NODE_LTS_VERSION }}
check-latest: true
- run: corepack enable

- name: Setup Node.js
uses: ./.github/actions/setup-node
Expand All @@ -44,12 +48,12 @@ jobs:
- name: Build benchmarks for tests
timeout-minutes: 120
run: |
cargo tp-bench-test --no-run
cargo test --benches --workspace --release --no-fail-fast --exclude turbopack-bench --no-run
- name: Run cargo test on benchmarks
timeout-minutes: 120
run: |
cargo tp-bench-test
cargo test --benches --workspace --release --no-fail-fast --exclude turbopack-bench
- name: Build benchmarks for tests for other bundlers
if: inputs.all
Expand Down

0 comments on commit f9f623b

Please sign in to comment.