mirror of
https://github.com/amigan/rustypaste-pretty.git
synced 2024-11-21 20:09:48 -05:00
chore(ci): add continuous integration workflow
This commit is contained in:
parent
c14c05abb3
commit
e497859da5
1 changed files with 108 additions and 0 deletions
108
.github/workflows/ci.yml
vendored
Normal file
108
.github/workflows/ci.yml
vendored
Normal file
|
@ -0,0 +1,108 @@
|
|||
name: Continuous Integration
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
|
||||
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
|
||||
run: cargo tarpaulin --out Xml --verbose
|
||||
- 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 }}
|
||||
|
||||
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
|
||||
args: --verbose -- -D warnings
|
||||
|
||||
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:
|
||||
args: --exclude "example|localhost|awesome.txt" -v *.md
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
Loading…
Reference in a new issue