From 2ee5993819554636466a0307ad02efc22458ca5d Mon Sep 17 00:00:00 2001 From: Matthias Goergens Date: Fri, 13 Dec 2024 16:33:02 +0800 Subject: [PATCH 1/2] Run `lints` job on GitHub's runners We are spending a lot of time restoring our cache on our self-hosted runners. So let's try offloading some of the CI work back to GitHub. Also upgrade our actions. --- .github/workflows/integration.yml | 4 ++-- .github/workflows/lints.yml | 25 ++++--------------------- .github/workflows/tests.yml | 4 ++-- 3 files changed, 8 insertions(+), 25 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 934fe3f3e..75e1e575c 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -33,9 +33,9 @@ jobs: runs-on: [self-hosted, Linux, X64] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Cargo cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | ~/.cargo/bin/ diff --git a/.github/workflows/lints.yml b/.github/workflows/lints.yml index 207769aa8..af60e8228 100644 --- a/.github/workflows/lints.yml +++ b/.github/workflows/lints.yml @@ -9,31 +9,13 @@ on: - master jobs: - skip_check: - runs-on: [self-hosted, Linux, X64] - outputs: - should_skip: ${{ steps.skip_check.outputs.should_skip }} - steps: - - id: skip_check - uses: fkirc/skip-duplicate-actions@v5 - with: - cancel_others: 'true' - concurrent_skipping: 'same_content_newer' - paths_ignore: '["**/README.md"]' - do_not_skip: '["pull_request", "workflow_dispatch", "schedule", "merge_group"]' - lints: - needs: [skip_check] - if: | - github.event.pull_request.draft == false && - (github.event.action == 'ready_for_review' || needs.skip_check.outputs.should_skip != 'true') - name: Various lints timeout-minutes: 30 - runs-on: [self-hosted, Linux, X64] + runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: components: rustfmt, clippy @@ -41,7 +23,7 @@ jobs: # TODO(Matthias): see whether we can keep this in sync with rust-toolchain.toml automatically? toolchain: nightly-2024-12-06 - name: Cargo cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | ~/.cargo/bin/ @@ -51,6 +33,7 @@ jobs: target/ guest/target/ key: lint-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: lint-${{ runner.os }}-cargo- - name: Install cargo make run: | diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e7d224995..ef7b8cc8e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -32,14 +32,14 @@ jobs: runs-on: [self-hosted, Linux, X64] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: targets: riscv32im-unknown-none-elf # TODO(Matthias): see whether we can keep this in sync with rust-toolchain.toml automatically? toolchain: nightly-2024-12-06 - name: Cargo cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | ~/.cargo/bin/ From ef3e2631d85fba8ae2e34f589951019313d78bad Mon Sep 17 00:00:00 2001 From: Matthias Goergens Date: Fri, 13 Dec 2024 16:56:06 +0800 Subject: [PATCH 2/2] Rum tests on github, too --- .github/workflows/integration.yml | 4 ++++ .github/workflows/lints.yml | 4 ++++ .github/workflows/tests.yml | 24 ++++++------------------ 3 files changed, 14 insertions(+), 18 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 75e1e575c..8bcc5dfed 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -8,6 +8,10 @@ on: branches: - master +concurrency: + group: ${{ github.workflow }}-${{ github.ref || github.run_id }} + cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} + jobs: skip_check: runs-on: [self-hosted, Linux, X64] diff --git a/.github/workflows/lints.yml b/.github/workflows/lints.yml index af60e8228..1f8d41b0b 100644 --- a/.github/workflows/lints.yml +++ b/.github/workflows/lints.yml @@ -8,6 +8,10 @@ on: branches: - master +concurrency: + group: ${{ github.workflow }}-${{ github.ref || github.run_id }} + cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} + jobs: lints: name: Various lints diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ef7b8cc8e..0f2ea9df3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -8,28 +8,15 @@ on: branches: - master -jobs: - skip_check: - runs-on: [self-hosted, Linux, X64] - outputs: - should_skip: ${{ steps.skip_check.outputs.should_skip }} - steps: - - id: skip_check - uses: fkirc/skip-duplicate-actions@v5 - with: - cancel_others: 'true' - concurrent_skipping: 'same_content_newer' - paths_ignore: '["**/README.md"]' - do_not_skip: '["pull_request", "workflow_dispatch", "schedule", "merge_group"]' +concurrency: + group: ${{ github.workflow }}-${{ github.ref || github.run_id }} + cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} +jobs: tests: - needs: [skip_check] - if: | - github.event.pull_request.draft == false && - (github.event.action == 'ready_for_review' || needs.skip_check.outputs.should_skip != 'true') name: Run Tests timeout-minutes: 30 - runs-on: [self-hosted, Linux, X64] + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 @@ -49,6 +36,7 @@ jobs: target/ guest/target/ key: tests-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: tests-${{ runner.os }}-cargo- - name: Install cargo make run: |