Update README.md #611
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
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
name: CI | |
jobs: | |
update-deps: | |
name: Update dependencies | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- id: cargo-deps | |
name: Cache cargo dependencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/registry/index | |
~/.cargo/registry/cache | |
~/.cargo/git/db | |
key: cargo-deps-${{ hashFiles('**/Cargo.lock') }} | |
- if: ${{ steps.cargo-deps.outputs.cache-hit != 'true' }} | |
id: ls-crates-io-index | |
name: Get head commit hash of crates.io registry index | |
run: | | |
commit=$( | |
git ls-remote --heads https://github.com/rust-lang/crates.io-index.git master | | |
cut -f 1 | |
) | |
echo "::set-output name=head::$commit" | |
- if: ${{ steps.cargo-deps.outputs.cache-hit != 'true' }} | |
name: Cache cargo registry index | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cargo/registry/index | |
key: cargo-index-${{ steps.ls-crates-io-index.outputs.head }} | |
restore-keys: | | |
cargo-index- | |
- if: ${{ steps.cargo-deps.outputs.cache-hit != 'true' }} | |
name: Fetch dependencies | |
run: cargo fetch --locked | |
test: | |
name: Test Suite | |
needs: update-deps | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
env: | |
CARGO_INCREMENTAL: 0 | |
NOTIFICATION_APP_CODE: ${{ secrets.NOTIFICATION_APP_CODE }} | |
NOTIFICATION_ACCESS_TOKEN: ${{ secrets.NOTIFICATION_ACCESS_TOKEN }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Allow long paths on Windows | |
if: ${{ runner.os == 'Windows' }} | |
shell: powershell | |
run: | | |
reg add HKLM\SYSTEM\CurrentControlSet\Control\FileSystem /v LongPathsEnabled /t REG_DWORD /d 1 /f | |
git config --system core.longpaths true | |
- if: ${{ runner.os == 'Windows' }} | |
name: Fix up Cargo.lock hash | |
run: | | |
Get-ChildItem . -Recurse -Filter Cargo.lock | | |
Foreach-Object { | |
((Get-Content $_.FullName) -join "`n") + "`n" | | |
Set-Content -NoNewline $_.FullName | |
} | |
- name: Restore cargo dependencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/registry/index | |
~/.cargo/registry/cache | |
~/.cargo/git/db | |
key: cargo-deps-${{ hashFiles('**/Cargo.lock') }} | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- name: Install libsqlite3 (Ubuntu) | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
sudo apt-get update | |
sudo apt-get install libsqlite3-dev | |
- uses: actions-rs/cargo@v1 | |
continue-on-error: false | |
with: | |
command: build | |
args: --locked | |
- uses: actions-rs/cargo@v1 | |
continue-on-error: false | |
with: | |
command: test | |
args: --locked --all-targets --all-features | |
lints: | |
name: Rust lints | |
needs: update-deps | |
runs-on: ubuntu-latest | |
env: | |
CARGO_INCREMENTAL: 0 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
components: rustfmt, clippy | |
- name: Run cargo fmt | |
uses: actions-rs/cargo@v1 | |
continue-on-error: false | |
with: | |
command: fmt | |
args: -- --check | |
- name: Restore cargo dependencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/registry/index | |
~/.cargo/registry/cache | |
~/.cargo/git/db | |
key: cargo-deps-${{ hashFiles('**/Cargo.lock') }} | |
- name: Run cargo clippy | |
uses: actions-rs/clippy-check@v1 | |
continue-on-error: false | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
args: --all-features -- --deny warnings | |
test_coverage: | |
name: Test Coverage | |
needs: update-deps | |
runs-on: ubuntu-latest | |
env: | |
CARGO_INCREMENTAL: 0 | |
NOTIFICATION_APP_CODE: ${{ secrets.NOTIFICATION_APP_CODE }} | |
NOTIFICATION_ACCESS_TOKEN: ${{ secrets.NOTIFICATION_ACCESS_TOKEN }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- name: Restore cargo registry index | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cargo/registry/index | |
key: 'cargo-index-v2-${{ needs.update_deps.outputs.crates-io-index-head }}' | |
- name: Restore dependency crates | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cargo/registry/cache | |
key: 'cargo-deps-v2-${{ hashFiles(''Cargo.lock'') }}' | |
- name: Run cargo-tarpaulin | |
uses: actions-rs/[email protected] | |
with: | |
args: '--ignore-tests --out Lcov' | |
timeout: 3600 | |
- name: upload to Coveralls | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
path-to-lcov: './lcov.info' |