You've already forked AstralRinth
forked from xxxOFFxxx/AstralRinth
* Switch to nightly + cranelift * Fail on warnings only in CI * Fix check errors * Don't use mold on Linux to fix CI * Pin nightly toolchain and add default rustup components * Fix another CI thing * PR comment
93 lines
2.4 KiB
YAML
93 lines
2.4 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
types: [opened, synchronize]
|
|
merge_group:
|
|
types: [checks_requested]
|
|
|
|
jobs:
|
|
build:
|
|
name: Lint and Test
|
|
runs-on: ubuntu-22.04
|
|
|
|
env:
|
|
# Ensure pnpm output is colored in GitHub Actions logs
|
|
FORCE_COLOR: 3
|
|
# Make cargo nextest successfully ignore projects without tests
|
|
NEXTEST_NO_TESTS: pass
|
|
# Fail on warnings in CI
|
|
# (but don't do this in the root `Cargo.toml`,
|
|
# since we don't want warnings to become errors
|
|
# while developing)
|
|
RUSTFLAGS: -Dwarnings
|
|
|
|
steps:
|
|
- name: 📥 Check out code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 2
|
|
|
|
- name: 🧰 Install build dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -yq libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-dev
|
|
|
|
- name: 🧰 Install pnpm
|
|
uses: pnpm/action-setup@v4
|
|
|
|
- name: 🧰 Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version-file: .nvmrc
|
|
cache: pnpm
|
|
|
|
- name: 🧰 Setup Rust toolchain
|
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
|
with:
|
|
rustflags: ''
|
|
components: clippy, rustfmt
|
|
cache: false
|
|
|
|
- name: 🧰 Setup nextest
|
|
uses: taiki-e/install-action@nextest
|
|
|
|
# cargo-binstall does not have pre-built binaries for sqlx-cli, so we fall
|
|
# back to a cached cargo install
|
|
- name: 🧰 Setup cargo-sqlx
|
|
uses: taiki-e/cache-cargo-install-action@v2
|
|
with:
|
|
tool: sqlx-cli
|
|
locked: false
|
|
no-default-features: true
|
|
features: rustls,postgres
|
|
|
|
- name: 💨 Setup Turbo cache
|
|
uses: rharkor/caching-for-turbo@v1.8
|
|
|
|
- name: 🧰 Install dependencies
|
|
run: pnpm install
|
|
|
|
- name: ⚙️ Start services
|
|
run: docker compose up --wait
|
|
|
|
- name: ⚙️ Setup labrinth environment and database
|
|
working-directory: apps/labrinth
|
|
run: |
|
|
cp .env.local .env
|
|
sqlx database setup
|
|
|
|
- name: ⚙️ Set app environment
|
|
working-directory: packages/app-lib
|
|
run: cp .env.staging .env
|
|
|
|
- name: 🔍 Lint and test
|
|
run: pnpm run ci
|
|
|
|
- name: 🔍 Verify intl:extract has been run
|
|
run: |
|
|
pnpm intl:extract
|
|
git diff --exit-code --color */*/src/locales/en-US/index.json
|