Skip to content

Speedup CI #1852

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 24 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
81fec34
Use `actions/checkout@v3`
AntoniosBarotsis Aug 28, 2023
cb1a46a
Switch to `dtolnay/rust-toolchain`
AntoniosBarotsis Aug 28, 2023
a205945
Fix typo
AntoniosBarotsis Aug 28, 2023
8601e64
Try manually install target
AntoniosBarotsis Aug 28, 2023
dc6a595
Add `Swatinem/rust-cache`
AntoniosBarotsis Aug 28, 2023
1237f90
Add comment for target install
AntoniosBarotsis Aug 28, 2023
26b9152
Empty commit to test CI
AntoniosBarotsis Aug 28, 2023
58a95b0
Invalidade cache for testing
AntoniosBarotsis Aug 28, 2023
d88cc8a
Switch to `rustsec/audit-check`
AntoniosBarotsis Aug 28, 2023
cf174da
Revert "Invalidade cache for testing"
AntoniosBarotsis Aug 28, 2023
c22a997
Fix comment
AntoniosBarotsis Aug 28, 2023
e3eb6f3
Merge branch 'master' into ci
AntoniosBarotsis Aug 29, 2023
8548a1a
Bump `actions/checkout`
AntoniosBarotsis Aug 29, 2023
2a8204e
Switch to `dtolnay/rust-toolchain`
AntoniosBarotsis Aug 29, 2023
aa12723
Add cache
AntoniosBarotsis Aug 29, 2023
5072f3a
Use OS instead of target in cache keys
AntoniosBarotsis Aug 29, 2023
5143123
Add shared key
AntoniosBarotsis Aug 29, 2023
5578018
Properly use shared keys
AntoniosBarotsis Aug 29, 2023
e45ba4c
Empty commit to test CI
AntoniosBarotsis Aug 29, 2023
eb9a65c
Only share the `build` job cache key
AntoniosBarotsis Aug 29, 2023
cadd8c9
Empty commit to test CI
AntoniosBarotsis Aug 29, 2023
2e9ab3c
Add cache to udeps and linting jobs
AntoniosBarotsis Aug 29, 2023
5a730b0
Should be `key` not `shared-key`
AntoniosBarotsis Aug 29, 2023
4839964
Empty commit to test CI
AntoniosBarotsis Aug 29, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,23 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Get version
id: get_version
run: echo ::set-output name=version::${GITHUB_REF/refs\/tags\//}

- name: Restore cargo cache
uses: Swatinem/rust-cache@v2
env:
cache-name: ci
with:
shared-key: ${{ matrix.os }}-${{ env.cache-name }}-stable

- name: Install Rust
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
profile: minimal
override: true
components: clippy

- name: Build
Expand Down
85 changes: 53 additions & 32 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,31 +22,23 @@ jobs:
continue-on-error: ${{ matrix.rust == 'nightly' }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Restore cargo cache
uses: actions/cache@v2
uses: Swatinem/rust-cache@v2
env:
cache-name: ci
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.cargo/bin
target
key: ${{ matrix.os }}-${{ env.cache-name }}-${{ matrix.rust }}-${{ hashFiles('Cargo.lock') }}
shared-key: ${{ matrix.os }}-${{ env.cache-name }}-${{ matrix.rust }}

- name: MacOS Workaround
if: matrix.os == 'macos-latest'
run: cargo clean -p serde_derive -p thiserror

- name: Install Rust
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust }}
default: true
override: true
profile: minimal
components: clippy

- name: Build Debug
Expand Down Expand Up @@ -97,15 +89,25 @@ jobs:
rust: [nightly, stable, '1.65']
continue-on-error: ${{ matrix.rust == 'nightly' }}
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v3

- name: Restore cargo cache
uses: Swatinem/rust-cache@v2
env:
cache-name: ci
with:
key: ubuntu-latest-${{ env.cache-name }}-${{ matrix.rust }}

- name: Install Rust
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust }}
profile: minimal
default: true
override: true
target: x86_64-unknown-linux-musl
targets: x86_64-unknown-linux-musl

# The build would fail without manually installing the target.
# https://github.com/dtolnay/rust-toolchain/issues/83
- name: Manually install target
run: rustup target add x86_64-unknown-linux-musl

- name: Setup MUSL
run: |
Expand Down Expand Up @@ -133,14 +135,19 @@ jobs:
rust: [nightly, stable, '1.65']
continue-on-error: ${{ matrix.rust == 'nightly' }}
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v3

- name: Restore cargo cache
uses: Swatinem/rust-cache@v2
env:
cache-name: ci
with:
key: ubuntu-latest-${{ env.cache-name }}-${{ matrix.rust }}

- name: Install Rust
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust }}
profile: minimal
default: true
override: true
- name: Setup ARM toolchain
run: |
rustup target add aarch64-unknown-linux-gnu
Expand Down Expand Up @@ -168,12 +175,19 @@ jobs:
name: Lints
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v3

- name: Restore cargo cache
uses: Swatinem/rust-cache@v2
env:
cache-name: ci
with:
key: ubuntu-latest-${{ env.cache-name }}-stable

- name: Install Rust
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
override: true
components: rustfmt

- run: cargo fmt -- --check
Expand All @@ -199,12 +213,19 @@ jobs:
name: udeps
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v3

- name: Restore cargo cache
uses: Swatinem/rust-cache@v2
env:
cache-name: ci
with:
key: ubuntu-latest-${{ env.cache-name }}-nightly

- name: Install Rust
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
override: true

- name: cargo-udeps
run: |
Expand All @@ -217,16 +238,16 @@ jobs:
name: Security audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/audit-check@v1
- uses: actions/checkout@v3
- uses: rustsec/audit-check@v1.4.1
with:
token: ${{ secrets.GITHUB_TOKEN }}

log-test:
name: Changelog Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v3
- name: Extract release notes
id: extract_release_notes
uses: ffurrer2/extract-release-notes@v1
Expand Down