Graphite/.github/workflows/ci.yml

92 lines
2.0 KiB
YAML

name: Continuous Integration
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: self-hosted
env:
RUSTC_WRAPPER: /usr/bin/sccache
CARGO_INCREMENTAL: 0
SCCACHE_DIR: /var/lib/github-actions/.cache
steps:
- uses: actions/checkout@v2
- name: 🔧 Set up Node
uses: actions/setup-node@v1
with:
node-version: '16.x'
- name: 🚧 Install Node dependencies
run: |
cd frontend
npm ci
- name: 🔼 Update Rust to latest stable
run: |
rustc --version
rustup update stable
rustc --version
- name: 🌐 Build Graphite web code
env:
NODE_ENV: production
SKIP_CARGO_ABOUT: true
run: |
cd frontend
mold -run npm run build
- name: 👕 Lint Graphite web formatting
env:
NODE_ENV: production
run: |
cd frontend
# npm run lint
echo "💥 Frontend linting is temporarily disabled until it can be set up again with Svelte 💥"
- name: 🔬 Check Rust formatting
run: |
mold -run cargo fmt --all -- --check
- name: 🦀 Build Rust code
run: |
mold -run cargo build
- name: 🧪 Run Rust tests
run: |
mold -run cargo nextest run
cargo-deny:
runs-on: ubuntu-latest
strategy:
matrix:
checks:
- 'crate security advisories'
- 'crate license compatibility'
# Prevent sudden announcement of a new advisory from failing ci:
continue-on-error: ${{ matrix.checks == 'crate security advisories' }}
steps:
- uses: actions/checkout@v2
- uses: EmbarkStudios/cargo-deny-action@v1
if: matrix.checks == 'crate security advisories'
with:
command: check advisories
- uses: EmbarkStudios/cargo-deny-action@v1
if: matrix.checks == 'crate license compatibility'
with:
command: check bans licenses sources