Skip to content

Use the packaged cargo lock file when installing cargo2junit in the C… #9

Use the packaged cargo lock file when installing cargo2junit in the C…

Use the packaged cargo lock file when installing cargo2junit in the C… #9

Workflow file for this run

name: CI
on: [push]
env:
CARGO_TERM_COLOR: always
jobs:
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- run: rustup component add rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: clippy
override: true
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features
name: Clippy Output
docs:
runs-on: ubuntu-latest
name: Docs
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: cargo doc
run: cargo doc --no-deps --all-features
env:
RUSTDOCFLAGS: --cfg docsrs
test:
name: Test
env:
PROJECT_NAME_UNDERSCORE: batsim
CARGO_INCREMENTAL: 0
RUSTFLAGS: -Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort
RUSTDOCFLAGS: -Cpanic=abort
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- name: Cache dependencies
uses: actions/cache@v3
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: Generate test result and coverage report
run: |
cargo install --locked cargo2junit grcov;
cargo test $CARGO_OPTIONS -v -- -Z unstable-options --format json | cargo2junit > results.xml;
zip -0 ccov.zip `find . \( -name "$PROJECT_NAME_UNDERSCORE*.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@v2
with:
check_name: Test Results
github_token: ${{ secrets.GITHUB_TOKEN }}
files: results.xml
# - name: Upload to CodeCov
# uses: codecov/codecov-action@v1
# with:
# # required for private repositories:
# token: ${{ secrets.CODECOV_TOKEN }}
# files: ./lcov.info
# fail_ci_if_error: true
- name: Send build success notification
if: success()
uses: rtCamp/[email protected]
env:
SLACK_MESSAGE: ${{ github.repository }} build ${{ github.run_number }} launched by ${{ github.actor }} has succeeded
SLACK_TITLE: Build Success
SLACK_CHANNEL: city-modelling-feeds
SLACK_USERNAME: GitHub Build Bot
SLACK_ICON: https://slack-files2.s3-us-west-2.amazonaws.com/avatars/2017-12-19/288981919427_f45f04edd92902a96859_512.png
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
- name: Send build failure notification
if: failure()
uses: rtCamp/[email protected]
env:
SLACK_COLOR: '#FF0000'
SLACK_MESSAGE: ${{ github.repository }} build ${{ github.run_number }} launched by ${{ github.actor }} has failed
SLACK_TITLE: Build Failure!
SLACK_CHANNEL: city-modelling-feeds
SLACK_USERNAME: GitHub Build Bot
SLACK_ICON: https://slack-files2.s3-us-west-2.amazonaws.com/avatars/2017-12-19/288981919427_f45f04edd92902a96859_512.png
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}