Files
spacedrive/.github/workflows/ci.yml
Brendan Allan 31df51501e CI Cache Factory (#593)
* introduce cache factory

run cache factory on all branches

add names

use single quotes

add setup and prisma generation

add pnpm install

don't install cargo-watch in ci

make composite setup script

use env var for windows ci

undo all powershell stuff

* better windows ci

* don't install cargo-watch in ci

* only run cache factory on main

* i'm silly

* debug only ci

* check runner instead of matrix in setup action

* don't save cache output most of the time

* no more os-specific features

* cache entire workspace

* only cache on main again

* test instead of buidl in cache factory

* smaller ci + testing

* don't individually test each crate

* remove unnecessary needs

* smaller formatting and more clippy

* undo rustfmt changes

* disable tests
2023-03-06 06:10:55 -08:00

120 lines
2.6 KiB
YAML

name: CI
on:
pull_request:
push:
branches:
- main
paths-ignore:
- '**/.md'
workflow_dispatch:
env:
SPACEDRIVE_CUSTOM_APT_FLAGS: --no-install-recommends
jobs:
typescript:
name: TypeScript
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install pnpm
uses: pnpm/action-setup@v2.2.2
with:
version: 7.x.x
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'pnpm'
- name: Install pnpm dependencies
run: pnpm i --frozen-lockfile
- name: Perform typechecks
run: pnpm typecheck
eslint:
name: ESLint
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install pnpm
uses: pnpm/action-setup@v2.2.2
with:
version: 7.x.x
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'pnpm'
- name: Install pnpm dependencies
run: pnpm i --frozen-lockfile
- name: Perform linting
run: pnpm lint
rustfmt:
name: Rust Formatting
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt
- name: Cache Rust deps
uses: Swatinem/rust-cache@v2
- name: Generate Prisma client
uses: ./.github/actions/generate-prisma-client
- name: Run rustfmt
run: cargo fmt --all -- --check
clippy:
name: Clippy (${{ matrix.platform }})
runs-on: ${{ matrix.platform }}
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup
uses: ./.github/actions/setup
- name: Run Clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --workspace --all-features
# test:
# name: Test (${{ matrix.platform }})
# runs-on: ${{ matrix.platform }}
# strategy:
# matrix:
# platform: [ubuntu-latest, macos-latest, windows-latest]
# steps:
# - name: Checkout repository
# uses: actions/checkout@v3
# - name: Setup
# uses: ./.github/actions/setup
# - name: Test
# run: cargo test --workspace --all-features