Skip to content

Workflow file for this run

name: Continuous integration
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
jobs:
tests:
runs-on: ubuntu-latest
continue-on-error: false
strategy:
matrix:
rust:
- 1.63.0
- stable
- beta
- nightly
include:
- rust: stable
target: thumbv7em-none-eabihf
- rust: beta
target: thumbv7em-none-eabihf
- rust: nightly
coverage: 'send'
components: llvm-tools
target: thumbv7em-none-eabihf
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install ${{ matrix.rust }} toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
components: ${{ matrix.components }}
target: ${{ matrix.target }}
override: true
- name: Install grcov
if: matrix.coverage == 'send'
uses: actions-rs/install@v0.1
with:
crate: grcov
version: latest
use-tool-cache: true
- name: Tests
env:
RUSTFLAGS: '-D warnings'
run: |
cargo build --verbose --no-default-features
cargo test --verbose --no-default-features
cargo build --verbose --no-default-features --features=lz,lh1,lhx
cargo test --verbose --no-default-features --features=lz,lh1,lhx
cargo build --verbose --no-default-features --features=std
cargo test --verbose --no-default-features --features=std
cargo build --verbose --no-default-features --features=std,lz
cargo test --verbose --no-default-features --features=std,lz
cargo build --verbose --no-default-features --features=std,lh1
cargo test --verbose --no-default-features --features=std,lh1
cargo build --verbose --all-features
cargo test --verbose --all-features
- name: Test embedded
if: matrix.target
env:
RUSTFLAGS: '-D warnings'
run: |
cargo build -p delharc-embedded-example --target ${{ matrix.target }}
- name: Coverage
if: matrix.coverage == 'send'
env:
LLVM_PROFILE_FILE: "delharc-%p-%m.profraw"
RUSTFLAGS: "-Cinstrument-coverage"
run: |
cargo build --verbose --all-features
cargo test --verbose --all-features
grcov . \
--binary-path ./target/debug/ \
--branch \
--output-types lcov \
--source-dir . \
--output-path ./lcov.info \
--ignore-not-existing \
--keep-only 'src/*' \
--commit-sha ${{ github.sha }} \
--service-job-id ${{ github.job }} \
--service-name "GitHub Actions" \
--service-number ${{ github.run_id }}
- name: Upload coverage as artifact
if: matrix.coverage == 'send'
uses: actions/upload-artifact@v2
with:
name: lcov.info
path: ./lcov.info
if-no-files-found: error
- name: Upload coverage to Coveralls
if: matrix.coverage == 'send'
uses: coverallsapp/github-action@v2
with:
file: lcov.info
format: lcov