Skip to content

Commit

Permalink
coverage test only on main branch
Browse files Browse the repository at this point in the history
  • Loading branch information
eguzki committed Sep 20, 2023
1 parent 670664f commit ec6dca9
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 12 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
name: Coverage

on:
push:
branches:
- '*'

jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: abelfodil/protoc-action@v1
with:
protoc-version: '3.19.4'
- uses: actions-rs/cargo@v1
with:
command: check

test:
name: Test Suite
runs-on: ubuntu-latest
services:
infinispan:
image: infinispan/server:11.0.9.Final
ports:
- 11222:11222
env:
USER: username
PASS: password
steps:
- uses: actions/checkout@v2
- uses: supercharge/redis-github-action@1.1.0
with:
redis-version: 5
# Nightly is required for code coverage with doctests
# https://github.com/taiki-e/cargo-llvm-cov/issues/2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- uses: abelfodil/protoc-action@v1
with:
protoc-version: '3.19.4'
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Test and Generate code coverage
run: cargo +nightly llvm-cov --all-features --workspace --lcov --doctests --output-path lcov.info
- name: Codecov
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
if: env.CODECOV_TOKEN != null
uses: codecov/codecov-action@v3
with:
verbose: true
fail_ci_if_error: false
16 changes: 4 additions & 12 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,23 +50,15 @@ jobs:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
toolchain: stable
override: true
- uses: abelfodil/protoc-action@v1
with:
protoc-version: '3.19.4'
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Test and Generate code coverage
run: cargo +nightly llvm-cov --all-features --workspace --lcov --doctests --output-path lcov.info
- name: Codecov
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
if: env.CODECOV_TOKEN != null
uses: codecov/codecov-action@v3
- uses: actions-rs/cargo@v1
with:
verbose: true
fail_ci_if_error: false
command: test
args: --all-features -vv

fmt:
name: Rustfmt
Expand Down

0 comments on commit ec6dca9

Please sign in to comment.