Skip to content

chore: updating message format #313

chore: updating message format

chore: updating message format #313

Workflow file for this run

on: [push, pull_request]
name: CI
jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- run: docker-compose -f scripts/tests/docker-compose.yml run -d -p 5432:5432 postgres
- run: sleep 10
- name: Run cargo check
uses: actions-rs/cargo@v1
with:
command: check
args: --all
test:
name: Test Suite
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- run: docker-compose -f scripts/tests/docker-compose.yml run -d -p 5432:5432 postgres
- run: sleep 10
- name: Run cargo test
uses: actions-rs/cargo@v1
with:
command: test
args: --all
doc:
name: Doc - build the documentation
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- run: docker-compose -f scripts/tests/docker-compose.yml run -d -p 5432:5432 postgres
- run: sleep 10
- run: cargo doc --no-deps --all --exclude bank
- uses: actions/upload-artifact@v1
with:
name: doc
path: target/doc
publish:
name: Publish
needs: [doc, check, test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Download doc
uses: actions/download-artifact@v1
with:
name: doc
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./doc
coverage:
name: Coverage
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
- run: docker-compose -f scripts/tests/docker-compose.yml run -d -p 5432:5432 postgres
- run: sleep 10
- uses: actions-rs/cargo@v1
with:
command: test
args: --all-features --no-fail-fast --all --exclude bank --exclude gift_shop
env:
CARGO_INCREMENTAL: '0'
RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests'
RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests'
- id: coverage
uses: actions-rs/grcov@v0.1
- name: Coveralls GitHub Action
uses: coverallsapp/github-action@v1.1.1
continue-on-error: true
with:
github-token: ${{ secrets.github_token }}
path-to-lcov: ${{ steps.coverage.outputs.report }}
sonarcloud:
name: SonarCloud and Linter
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Install toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.77.1
components: clippy rustfmt llvm-tools-preview
- uses: taiki-e/install-action@grcov
- uses: taiki-e/install-action@protoc
- name: Install cargo-sonar and run Clippy
run: |
cargo install cargo-sonar
cargo clippy --message-format json > my-clippy-report.json
cargo sonar --clippy --clippy-path my-clippy-report.json
- name: Build with coverage
env:
RUST_LOG: info
RUSTFLAGS: "-Cinstrument-coverage"
RUSTDOCFLAGS: "-Cinstrument-coverage"
LLVM_PROFILE_FILE: "codecov-instrumentation-%p-%m.profraw"
run: cargo build
- name: Run grcov
run: |
grcov . --binary-path target/debug/ -s . \
-t lcov \
--branch \
--ignore-not-existing \
--ignore '../**' \
--ignore '/*' \
-o coverage.lcov
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
-Dsonar.externalIssuesReportPaths=sonar-issues.json
-Dcommunity.rust.lcov.reportPaths=lcov.info