Speedup CI (#43)

* No need to build on nightly: This crate works on stable
* Use larger runners where applicable (linux)
* Only run the tests on macOS and Windows: The rest is OS independent
This commit is contained in:
Alexander Theißen
2023-01-10 16:01:52 -03:00
committed by GitHub
parent 54213f77f6
commit 74716698f5
+50 -35
View File
@@ -11,7 +11,7 @@ env:
jobs: jobs:
rustfmt: rustfmt:
runs-on: "ubuntu-latest" runs-on: "ubuntu_20_64_core"
steps: steps:
- name: Install Rust toolchain - name: Install Rust toolchain
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
@@ -22,7 +22,7 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Cargo fmt - name: Fmt
uses: actions-rs/cargo@v1 uses: actions-rs/cargo@v1
with: with:
toolchain: nightly toolchain: nightly
@@ -30,7 +30,7 @@ jobs:
args: --all -- --check args: --all -- --check
clippy: clippy:
runs-on: "ubuntu-latest" runs-on: "ubuntu_20_64_core"
steps: steps:
- name: Install Rust toolchain - name: Install Rust toolchain
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
@@ -38,29 +38,64 @@ jobs:
profile: minimal profile: minimal
toolchain: stable toolchain: stable
components: clippy components: clippy
default: true
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Cargo clippy - name: Clippy
uses: actions-rs/cargo@v1 uses: actions-rs/clippy-check@v1
with: with:
toolchain: stable token: ${{ secrets.GITHUB_TOKEN }}
command: clippy
args: --all-targets --all-features -- -D warnings args: --all-targets --all-features -- -D warnings
test: build:
strategy: runs-on: "ubuntu_20_64_core"
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
toolchain: ["stable", "nightly"]
runs-on: ${{ matrix.os }}
steps: steps:
- name: Install Rust toolchain - name: Install Rust toolchain
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
profile: minimal profile: minimal
target: wasm32-unknown-unknown target: wasm32-unknown-unknown
toolchain: ${{ matrix.toolchain }} toolchain: stable
default: true
- uses: actions/checkout@v3
- name: Cargo build
uses: actions-rs/cargo@v1
with:
command: build
- name: Cargo build (std)
uses: actions-rs/cargo@v1
with:
command: build
args: --all-features
- name: Cargo build (no_std)
uses: actions-rs/cargo@v1
with:
command: build
args: --no-default-features
- name: Cargo build (wasm)
uses: actions-rs/cargo@v1
with:
command: build
args: --no-default-features --target wasm32-unknown-unknown
test:
strategy:
matrix:
os: ["ubuntu_20_64_core", "macos-latest", "windows-latest"]
runs-on: ${{ matrix.os }}
steps:
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
default: true
- name: Set git to use LF - name: Set git to use LF
run: | run: |
@@ -69,29 +104,9 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Cargo build
uses: actions-rs/cargo@v1
with:
toolchain: ${{ matrix.toolchain }}
command: build
- name: Cargo build (no_std)
uses: actions-rs/cargo@v1
with:
toolchain: ${{ matrix.toolchain }}
command: build
args: --no-default-features
- name: Cargo build (wasm)
uses: actions-rs/cargo@v1
with:
toolchain: ${{ matrix.toolchain }}
command: build
args: --no-default-features --target wasm32-unknown-unknown
- name: Cargo test - name: Cargo test
uses: actions-rs/cargo@v1 uses: actions-rs/cargo@v1
with: with:
toolchain: ${{ matrix.toolchain }}
command: test command: test
args: --all-features args: --all-features