add simple contribution notes #11
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: '0 6 * * 1-5' # run once per day Monday-Friday at 6:00am | |
env: | |
RUST_BACKTRACE: 1 | |
CARGO_TERM_COLOR: always | |
CARGO_TERM_VERBOSE: 'true' | |
RUSTFLAGS: -Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort | |
RUSTDOCFLAGS: -Cpanic=abort | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
toolchain: | |
- stable | |
- beta | |
- nightly | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
# - name: Check semver | |
# uses: obi1kenobi/cargo-semver-checks-action@v2 | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: ${{ matrix.toolchain }} | |
override: true | |
- name: Cache dependencies | |
uses: actions/cache@v2 | |
env: | |
cache-name: cache-dependencies | |
with: | |
path: | | |
~/.cargo/.crates.toml | |
~/.cargo/.crates2.json | |
~/.cargo/bin | |
~/.cargo/registry/index | |
~/.cargo/registry/cache | |
target | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('Cargo.lock') }} | |
- name: Build | |
run: cargo build --verbose | |
- name: Test | |
run: cargo test -- -Z unstable-options --format json --report-time | tee test_results_debug.json | |
env: # See https://github.com/johnterickson/cargo2junit/issues/79 | |
RUSTC_BOOTSTRAP: 1 | |
- name: Build Release | |
run: cargo build --release --verbose | |
- name: Test release | |
run: cargo test --release -- -Z unstable-options --format json --report-time | tee test_results_release.json | |
env: # See https://github.com/johnterickson/cargo2junit/issues/79 | |
RUSTC_BOOTSTRAP: 1 | |
- name: Generate test result and coverage report | |
run: | | |
cargo install cargo2junit grcov; | |
cargo test $CARGO_OPTIONS -- -Z unstable-options --format json | cargo2junit > results.xml; | |
zip -0 ccov.zip `find . \( -name "zigbee-rs*.gc*" \) -print`; | |
grcov ccov.zip -s . -t lcov --llvm --ignore-not-existing --ignore "/*" --ignore "tests/*" -o lcov.info; | |
- name: Upload test results | |
uses: EnricoMi/publish-unit-test-result-action@v1 | |
with: | |
check_name: Test Results | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
files: results.xml | |
- name: Publish Test Report Release | |
uses: mikepenz/action-junit-report@v3 | |
if: always() | |
with: | |
comment: true | |
report_paths: 'test_results_release.xml' | |
check_title_template: ${{ matrix.name }} release | |