From 0e50f765548dc067e61a65b0a6b573e4f377ce5e Mon Sep 17 00:00:00 2001 From: Ernestas Kulik Date: Mon, 2 May 2022 10:20:07 +0300 Subject: [PATCH 1/4] github: Allow running workflow manually --- .github/workflows/primary.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/primary.yml b/.github/workflows/primary.yml index f2d6917..171d1d7 100644 --- a/.github/workflows/primary.yml +++ b/.github/workflows/primary.yml @@ -7,6 +7,7 @@ on: branches: ["*"] pull_request: branches: [main] + workflow_dispatch: env: CARGO_TERM_COLOR: always From b593a79ca972470b926412396ff5db5aca375f9c Mon Sep 17 00:00:00 2001 From: Ernestas Kulik Date: Mon, 2 May 2022 10:47:40 +0300 Subject: [PATCH 2/4] github: Remove push trigger filter Since the filter allows all branches, it can be removed. --- .github/workflows/primary.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/primary.yml b/.github/workflows/primary.yml index 171d1d7..04cff08 100644 --- a/.github/workflows/primary.yml +++ b/.github/workflows/primary.yml @@ -4,7 +4,6 @@ on: schedule: - cron: "0 0 * * 6" push: - branches: ["*"] pull_request: branches: [main] workflow_dispatch: From 9ac10621438bbe36e8fe7de97c035d3b04ae6b7b Mon Sep 17 00:00:00 2001 From: Ernestas Kulik Date: Mon, 2 May 2022 10:49:54 +0300 Subject: [PATCH 3/4] github: Run on Ubuntu 22.04 Currently, tests are run on 18.04 and 20.04, but 22.04 is out already, so this commit drops 18.04 and adds the latest release. --- .github/workflows/primary.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/primary.yml b/.github/workflows/primary.yml index 04cff08..56e434d 100644 --- a/.github/workflows/primary.yml +++ b/.github/workflows/primary.yml @@ -13,7 +13,7 @@ env: jobs: clippy: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 timeout-minutes: 10 steps: - uses: actions/checkout@v2 @@ -38,7 +38,7 @@ jobs: timeout-minutes: 10 strategy: matrix: - os: [ubuntu-18.04, ubuntu-20.04] + os: [ubuntu-20.04, ubuntu-22.04] steps: - uses: actions/checkout@v2 - uses: Swatinem/rust-cache@v1 From 04659f6cb1d0486f35fdc4b6802be5d416a4b352 Mon Sep 17 00:00:00 2001 From: Ernestas Kulik Date: Mon, 2 May 2022 10:13:15 +0300 Subject: [PATCH 4/4] github: Report code coverage Closes https://github.com/gluxon/nldl/issues/4 --- .github/workflows/primary.yml | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/.github/workflows/primary.yml b/.github/workflows/primary.yml index 56e434d..7935508 100644 --- a/.github/workflows/primary.yml +++ b/.github/workflows/primary.yml @@ -42,10 +42,37 @@ jobs: steps: - uses: actions/checkout@v2 - uses: Swatinem/rust-cache@v1 - - name: Build - run: cargo build --tests --verbose - - name: Run tests - run: cargo test --verbose + - uses: actions-rs/toolchain@v1 + with: + components: llvm-tools-preview + override: true + toolchain: stable + - uses: actions-rs/cargo@v1 + with: + command: test + args: --all-features --no-fail-fast + env: + LLVM_PROFILE_FILE: "nldl-%p-%m.profraw" + RUSTFLAGS: '-Cinstrument-coverage' + - uses: actions-rs/cargo@v1 + with: + command: install + args: grcov + - id: coverage + run: | + grcov \ + --branch \ + --ignore-not-existing \ + --llvm \ + --binary-path=target/debug/ \ + --output-path=target/debug/lcov.info \ + --output-type=lcov \ + --source-dir=. \ + . + echo '::set-output name=report::target/debug/lcov.info' + - uses: codecov/codecov-action@v2 + with: + files: ${{ steps.coverage.outputs.report }} check-readme: runs-on: ubuntu-latest