diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index dfec8af..8c33da7 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -4,11 +4,13 @@ run-name: ${{ github.actor }} is building action on: push: branches: + - 'actions/**' - 'master' jobs: - dependencies: + build: runs-on: ubuntu-20.04 + steps: - name: Install prerequisites run: | @@ -21,6 +23,36 @@ jobs: - uses: actions/checkout@v3 - name: Build project run: cargo build --verbose --jobs $(nproc) - - - name: Run tests - run: cargo test --lib --bins --tests --jobs $(nproc) + + coverage: + runs-on: ubuntu-20.04 + needs: [build] + + steps: + # - name: Install prerequisites + # run: | + # sudo apt update + # sudo apt install -y build-essential curl \ + # cmake clang libclang-dev llvm llvm-dev \ + # qt5-default libopencv-dev \ + # python3-dev python3-numpy python3-opencv + + - uses: actions/checkout@v3 + - uses: Swatinem/rust-cache@v2 + continue-on-error: true + + - uses: dtolnay/rust-toolchain@stable + with: + components: llvm-tools-preview + + - name: Install cargo-llvm-cov + uses: taiki-e/install-action@cargo-llvm-cov + + - name: Generate code coverage + run: cargo llvm-cov --codecov --output-path coverage.json + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v2 + with: + file: coverage.json + fail_ci_if_error: true diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 9e3f7c2..8a7f583 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -23,6 +23,3 @@ jobs: - name: Run tests run: cargo test --lib --bins --tests --jobs $(nproc) - -# - name: Build docs -# run: cargo doc --lib --verbose --jobs $(nproc)