Merge pull request #315 from embassy-rs/ci-fixes

Optimize CI
This commit is contained in:
Thales 2021-07-26 19:24:54 -03:00 committed by GitHub
commit d83cd3fffd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -95,21 +95,24 @@ jobs:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with: with:
submodules: true submodules: true
- uses: actions-rs/toolchain@v1 - uses: actions/cache@v2
with: with:
toolchain: stable path: |
- name: cache ~/.cargo/bin/
id: cache-target ~/.cargo/registry/index/
uses: actions/cache@v2 ~/.cargo/registry/cache/
with: ~/.cargo/git/db/
path: target target/
key: ${{ runner.os }}-${{ matrix.target }} key: ${{ runner.os }}-cargo-${{ matrix.target }}-${{ hashFiles('**/Cargo.toml') }}
restore-keys: |
${{ runner.os }}-cargo-${{ matrix.target }}-
# We have to append the "-D warnings" flag to .cargo/config rather than # We have to append the "-D warnings" flag to .cargo/config rather than
# using the RUSTFLAGS environment variable because if we set RUSTFLAGS # using the RUSTFLAGS environment variable because if we set RUSTFLAGS
# cargo will ignore the rustflags config in .cargo/config. # cargo will ignore the rustflags config in .cargo/config.
- name: Check - name: Check
run: | run: |
export CARGO_TARGET_DIR=$PWD/target
mkdir -p .cargo mkdir -p .cargo
echo -e '[target."cfg(all())"]\nrustflags = ["-D", "warnings"]' >> .cargo/config echo -e '[target."cfg(all())"]\nrustflags = ["-D", "warnings"]' >> .cargo/config
cd ${{ matrix.package }} && RUSTFLAGS=-Dwarnings cargo check --features=${{ matrix.features }} --target=${{ matrix.target }} cd ${{ matrix.package }} && RUSTFLAGS=-Dwarnings cargo check --features=${{ matrix.features }} --target=${{ matrix.target }}
@ -118,9 +121,6 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Check fmt - name: Check fmt
run: for i in embassy-*; do (cd $i; cargo fmt -- --check); done run: for i in embassy-*; do (cd $i; cargo fmt -- --check); done
@ -128,11 +128,22 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1 - uses: actions/cache@v2
with: with:
toolchain: stable path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Test - name: Test
run: cd embassy && cargo test run: |
export CARGO_TARGET_DIR=$PWD/target
cd embassy
cargo test
metapac_gen: metapac_gen:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -140,8 +151,19 @@ jobs:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with: with:
submodules: true submodules: true
- uses: actions-rs/toolchain@v1 - uses: actions/cache@v2
with: with:
toolchain: stable path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Generate pregenerated metapac - name: Generate pregenerated metapac
run: cd stm32-metapac-gen; cargo run --release run: |
export CARGO_TARGET_DIR=$PWD/target
cd stm32-metapac-gen
cargo run --release