Skip to content

Frontend tweak

Frontend tweak #145

Workflow file for this run

name: CI
on: [pull_request, workflow_dispatch]
jobs:
check:
name: Check
runs-on: ubuntu-latest
defaults:
run:
working-directory: server
steps:
- uses: actions/checkout@v2
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
server:
- 'server/**'
- name: Install toolchain
if: steps.filter.outputs.server == 'true'
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
if: steps.filter.outputs.server == 'true'
with:
# An explicit cache key that is used instead of the automatic `job`-based
# cache key and is thus stable across jobs.
# Default: empty
shared-key: ""
# An additional cache key that is added alongside the automatic `job`-based
# cache key and can be used to further differentiate jobs.
# Default: empty
key: ""
# A whitespace separated list of env-var *prefixes* who's value contributes
# to the environment cache key.
# The env-vars are matched by *prefix*, so the default `RUST` var will
# match all of `RUSTC`, `RUSTUP_*`, `RUSTFLAGS`, `RUSTDOC_*`, etc.
# Default: "CARGO CC CFLAGS CXX CMAKE RUST"
env-vars: ""
# The cargo workspaces and target directory configuration.
# These entries are separated by newlines and have the form
# `$workspace -> $target`. The `$target` part is treated as a directory
# relative to the `$workspace` and defaults to "target" if not explicitly given.
workspaces: "server"
# Determines if the cache should be saved even when the workflow has failed.
cache-on-failure: true
- name: Check
if: steps.filter.outputs.server == 'true'
run: cargo check
- name: Tests
if: steps.filter.outputs.server == 'true'
run: cargo test
- name: Rustfmt
if: steps.filter.outputs.server == 'true'
run: cargo fmt --all -- --check
- name: Clippy
if: steps.filter.outputs.server == 'true'
run: cargo clippy -- -D warnings