2021-05-30 20:03:53 +00:00
|
|
|
name: Rust
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ main ]
|
|
|
|
pull_request:
|
2021-08-31 18:00:12 +00:00
|
|
|
types: [opened, reopened, synchronize]
|
2021-05-30 20:03:53 +00:00
|
|
|
|
|
|
|
env:
|
|
|
|
CARGO_TERM_COLOR: always
|
|
|
|
|
|
|
|
jobs:
|
2021-06-23 09:13:18 +00:00
|
|
|
test:
|
|
|
|
name: cargo test
|
2021-06-23 08:57:43 +00:00
|
|
|
runs-on: ubuntu-latest
|
2021-05-30 20:03:53 +00:00
|
|
|
|
2021-06-23 08:57:43 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout sources
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Build
|
2021-06-23 09:13:18 +00:00
|
|
|
run: cargo build --verbose --workspace
|
2021-06-23 08:57:43 +00:00
|
|
|
- name: Run tests
|
2021-06-23 09:13:18 +00:00
|
|
|
run: cargo test --verbose --workspace
|
2021-08-26 19:46:00 +00:00
|
|
|
- name: Generate GraphQL schema
|
|
|
|
run: cargo run -- export_graphql_schema -o generated_schema.graphql
|
|
|
|
- name: Check schema
|
|
|
|
run: diff schema.graphql generated_schema.graphql
|
|
|
|
|
2021-06-23 08:57:43 +00:00
|
|
|
|
|
|
|
clippy:
|
|
|
|
name: cargo clippy
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout sources
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Install nightly toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
profile: minimal
|
|
|
|
toolchain: nightly
|
|
|
|
override: true
|
|
|
|
components: rustfmt, clippy
|
|
|
|
|
2021-06-23 09:13:18 +00:00
|
|
|
- name: Run cargo clippy
|
2021-06-23 08:57:43 +00:00
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: clippy
|
2021-06-23 09:13:18 +00:00
|
|
|
args: --tests --all -- -D warnings
|
2021-06-23 08:57:43 +00:00
|
|
|
|
|
|
|
format:
|
|
|
|
name: cargo fmt
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout sources
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Install nightly toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
profile: minimal
|
|
|
|
toolchain: nightly
|
|
|
|
override: true
|
|
|
|
components: rustfmt, clippy
|
|
|
|
|
2021-06-23 09:13:18 +00:00
|
|
|
- name: Run cargo fmt
|
2021-06-23 08:57:43 +00:00
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: fmt
|
|
|
|
args: --all -- --check
|