From 596ce2615712616e4ac0e07bd6ff89d0b42c8638 Mon Sep 17 00:00:00 2001 From: Matt Hammerly Date: Tue, 9 Jan 2024 10:52:04 -0800 Subject: [PATCH] add github actions --- .github/workflows/ci.yml | 68 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..9928250 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,68 @@ +name: codecov-rs CI + +on: + push: + branches: + - main + pull_request: + + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + lint: + name: Lint (rustfmt + clippy) + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: stable + - name: Run lint + run: | + cargo fmt --all --check + cargo clippy + + build: + name: Build + runs-on: ubuntu-latest + strategy: + fail-fast: false + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: stable + - name: Run build + run: | + cargo build + test: + name: Test + runs-on: ubuntu-latest + strategy: + fail-fast: false + steps: + - name: Checkout + uses: actions/checkout@v4-beta + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: stable + - name: Run tests + run: | + cargo test + - name: Install `cargo llvm-cov` + uses: taiki-e/install-action@cargo-llvm-cov + - name: Collect coverage + run: | + cargo llvm-cov --no-default-features --lcov --output-path lcov.info + - name: Upload to Codecov + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_ORG_TOKEN }}