2021-07-27 06:40:34 -04:00
|
|
|
name: Continuous Integration
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- master
|
2021-10-12 12:46:32 -04:00
|
|
|
schedule:
|
2022-05-21 08:46:37 -04:00
|
|
|
- cron: '0 0 * * 0'
|
2021-07-27 06:40:34 -04:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
check:
|
|
|
|
name: Check
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
|
|
|
- name: Install Rust toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
profile: minimal
|
|
|
|
override: true
|
|
|
|
- name: Checkout the repository
|
|
|
|
uses: actions/checkout@master
|
|
|
|
- name: Check the project files
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: check
|
|
|
|
args: --locked --verbose
|
|
|
|
|
|
|
|
test:
|
|
|
|
name: Test suite
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
|
|
|
- name: Install Rust toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
override: true
|
|
|
|
- name: Checkout the repository
|
|
|
|
uses: actions/checkout@master
|
|
|
|
- name: Setup cargo-tarpaulin
|
|
|
|
run: |
|
|
|
|
curl -s https://api.github.com/repos/xd009642/tarpaulin/releases/latest | \
|
|
|
|
grep "browser_download_url.*tar.gz" | cut -d : -f 2,3 | tr -d \" | wget -qi -
|
|
|
|
tar -xzf cargo-tarpaulin-*.tar.gz
|
|
|
|
mv cargo-tarpaulin ~/.cargo/bin/
|
|
|
|
- name: Run tests
|
2022-03-23 04:38:32 -04:00
|
|
|
run: cargo tarpaulin --out Xml --verbose -- --test-threads 1
|
2021-07-27 06:40:34 -04:00
|
|
|
- name: Upload reports to codecov
|
|
|
|
uses: codecov/codecov-action@v1
|
|
|
|
with:
|
|
|
|
name: code-coverage-report
|
|
|
|
file: cobertura.xml
|
|
|
|
flags: unit-tests
|
|
|
|
fail_ci_if_error: true
|
|
|
|
verbose: true
|
|
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
|
2022-05-21 08:46:37 -04:00
|
|
|
fixtures:
|
|
|
|
name: Test fixtures
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
|
|
|
- name: Install Rust toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
profile: minimal
|
|
|
|
override: true
|
|
|
|
- name: Checkout the repository
|
|
|
|
uses: actions/checkout@master
|
|
|
|
- name: Build the project
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: build
|
|
|
|
args: --locked --verbose
|
|
|
|
- name: Run test fixtures
|
|
|
|
shell: bash
|
|
|
|
run: ./test-fixtures.sh
|
|
|
|
working-directory: fixtures
|
|
|
|
env:
|
|
|
|
DEBUG: true
|
|
|
|
|
2021-07-27 06:40:34 -04:00
|
|
|
clippy:
|
|
|
|
name: Lints
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
|
|
|
- name: Install Rust toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
profile: minimal
|
|
|
|
components: clippy
|
|
|
|
override: true
|
|
|
|
- name: Checkout the repository
|
|
|
|
uses: actions/checkout@master
|
|
|
|
- name: Check the lints
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: clippy
|
2022-05-16 05:58:41 -04:00
|
|
|
args: --tests --verbose -- -D warnings
|
2021-07-27 06:40:34 -04:00
|
|
|
|
|
|
|
rustfmt:
|
|
|
|
name: Formatting
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
|
|
|
- name: Install Rust toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
profile: minimal
|
|
|
|
components: rustfmt
|
|
|
|
override: true
|
|
|
|
- name: Checkout the repository
|
|
|
|
uses: actions/checkout@master
|
|
|
|
- name: Check the formatting
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: fmt
|
|
|
|
args: -- --check --verbose
|
|
|
|
|
|
|
|
lychee:
|
|
|
|
name: Links
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
|
|
|
- name: Checkout the repository
|
|
|
|
uses: actions/checkout@master
|
|
|
|
- name: Check the links
|
|
|
|
uses: lycheeverse/lychee-action@v1
|
|
|
|
with:
|
2021-08-26 16:15:47 -04:00
|
|
|
args: --exclude "example.com|site.com|localhost|awesome.txt|x.txt" -v *.md
|
2021-07-27 06:40:34 -04:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|