More CI #12
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: CI | |
on: push | |
jobs: | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
toolchain: nightly | |
components: rustfmt, clippy | |
rustflags: -Dwarnings | |
- name: Lint (clippy) | |
run: cargo clippy # Eventually there will be a actions-rust-lang version with problem matching | |
- name: Lint (rustfmt) | |
uses: actions-rust-lang/rustfmt@v1 | |
build: | |
name: Build and test | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
rust-version: [stable, 1.65, nightly] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
toolchain: ${{ matrix.rust-version }} | |
- name: Setup test deps | |
run: sudo apt-get install -y xinetd tftpd tftp | |
- name: Create directory for tftp | |
run: mkdir /tmp/tftp | |
- name: Run TFTP server | |
run: sudo in.tftpd -L -s /tmp/tftp --create & | |
- name: Tests | |
run: cargo test | |
- name: Install cargo-llvm-cov | |
uses: taiki-e/install-action@cargo-llvm-cov | |
- name: Generate code coverage | |
if: startsWith(matrix.rust-version, 'stable') | |
run: cargo llvm-cov --workspace --lcov --output-path lcov.info | |
- name: Upload coverage to Codecov | |
if: startsWith(matrix.rust-version, 'stable') | |
uses: codecov/codecov-action@v3 | |
with: | |
files: lcov.info | |
fail_ci_if_error: true |