Add CI
This commit is contained in:
parent
2804af92e5
commit
43ead2edb8
1
.github/FUNDING.yml
vendored
Normal file
1
.github/FUNDING.yml
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
github: qarmin
|
75
.github/workflows/ci.yml
vendored
Normal file
75
.github/workflows/ci.yml
vendored
Normal file
|
@ -0,0 +1,75 @@
|
||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [master]
|
||||||
|
pull_request:
|
||||||
|
branches: [master]
|
||||||
|
|
||||||
|
env:
|
||||||
|
CARGO_TERM_COLOR: always
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
toolchain: [stable, nightly]
|
||||||
|
os: [ubuntu-20.04]
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
needs: clean
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
toolchain: ${{ matrix.toolchain }}
|
||||||
|
override: true
|
||||||
|
|
||||||
|
- uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
target
|
||||||
|
key: ${{ runner.os }}-cargo-check-test-${{ matrix.toolchain }}-${{ hashFiles('**/Cargo.lock') }}
|
||||||
|
|
||||||
|
- name: Install Gtk
|
||||||
|
run: sudo apt-get update; sudo apt install -y libgtk-3-dev
|
||||||
|
if: ${{ runner.os == 'Linux' }}
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: cargo check --all
|
||||||
|
env:
|
||||||
|
CARGO_INCREMENTAL: 0
|
||||||
|
RUSTFLAGS: "-C debuginfo=0 -D warnings"
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
run: cargo test
|
||||||
|
if: ${{ runner.os == 'Linux' }}
|
||||||
|
env:
|
||||||
|
CARGO_INCREMENTAL: 0
|
||||||
|
RUSTFLAGS: "-C debuginfo=0 -D warnings"
|
||||||
|
|
||||||
|
clean:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
toolchain: stable
|
||||||
|
components: rustfmt, clippy
|
||||||
|
override: true
|
||||||
|
|
||||||
|
- name: Install Gtk
|
||||||
|
run: sudo apt install -y libgtk-3-dev
|
||||||
|
|
||||||
|
- name: Check the format
|
||||||
|
run: cargo fmt --all -- --check
|
||||||
|
|
||||||
|
# type complexity must be ignored because we use huge templates for queries
|
||||||
|
- name: Run clippy
|
||||||
|
run: >
|
||||||
|
cargo clippy
|
||||||
|
--all-targets
|
||||||
|
--all-features
|
||||||
|
--
|
||||||
|
-D warnings
|
Loading…
Reference in a new issue