fix: GitHub Actions build produce a broken build (#2) #33
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Rust | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install rust | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: stable | |
components: clippy, rustfmt | |
- name: Install cargo-llvm-cov | |
uses: taiki-e/install-action@cargo-llvm-cov | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-rust-test-${{ hashFiles('**/Cargo.lock') }} | |
- name: Run cargo fmt | |
run: cargo fmt -- --check | |
- name: Run clippy | |
run: cargo clippy -- -D warnings | |
- name: Run cargo check | |
run: cargo check --all-features --locked --release | |
- name: Run cargo build | |
run: cargo build --locked --release | |
- name: Generate code coverage | |
run: cargo llvm-cov --all-features --lcov --output-path lcov.info | |
- name: Upload coverage to codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: lcov.info | |
fail_ci_if_error: true | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install rust | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: stable | |
- name: Install zig | |
uses: goto-bus-stop/setup-zig@v2 | |
with: | |
version: 0.10.0 | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
~/.cargo/bin | |
target | |
key: ${{ runner.os }}-rust-build-${{ hashFiles('**/Cargo.lock') }} | |
- name: Install Cargo Lambda | |
uses: jaxxstorm/action-install-gh-release@v1.9.0 | |
with: | |
repo: cargo-lambda/cargo-lambda | |
platform: linux | |
arch: x86_64 | |
- name: Run cargo lambda build | |
run: cargo lambda build --locked --release |