Skip to content

New recording flow #2875

New recording flow

New recording flow #2875

Workflow file for this run

name: "CI"
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
jobs:
changes:
name: Detect Changes
runs-on: ubuntu-latest
outputs:
rust: ${{ steps.filter.outputs.rust }}
tauri-plugins: ${{ steps.filter.outputs.tauri-plugins }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check for changes
uses: dorny/paths-filter@v2
id: filter
with:
filters: |
rust:
- '.cargo/**'
- '.github/**'
- 'crates/**'
- 'apps/desktop/src-tauri/**'
- 'Cargo.toml'
- 'Cargo.lock'
tauri-plugins:
- 'Cargo.lock'
- 'pnpm-lock.yaml'
typecheck:
name: Typecheck
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: ./.github/actions/setup-js
- name: Typecheck
run: pnpm typecheck
format-biome:
name: Format (Biome)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Biome
uses: biomejs/setup-biome@v2
with:
# Don't use `latest` as Biome throws an error when it doesn't match the
# schema version in the config file.
version: 2.2.0
- name: Run Biome
run: biome ci . --linter-enabled=false
format-rust:
name: Format (Cargo)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Check formatting
run: cargo fmt --check
clippy:
name: Clippy
runs-on: macos-latest
needs: changes
if: needs.changes.outputs.rust == 'true'
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Rust setup
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.settings.target }}
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
shared-key: ${{ matrix.settings.target }}
- name: Create .env file in root
run: |
echo "VITE_ENVIRONMENT=production" >> .env
echo "CAP_DESKTOP_SENTRY_URL=https://6a3b6a09e6ae976c2ad6fff710e88748@o4506859771527168.ingest.us.sentry.io/4508330917101568" >> .env
echo "NEXT_PUBLIC_WEB_URL=${{ secrets.NEXT_PUBLIC_WEB_URL }}" >> .env
echo 'NEXTAUTH_URL=${{ secrets.NEXT_PUBLIC_WEB_URL }}' >> .env
echo 'NEXT_PUBLIC_POSTHOG_KEY=${{ secrets.NEXT_PUBLIC_POSTHOG_KEY }}' >> .env
echo 'NEXT_PUBLIC_POSTHOG_HOST=${{ secrets.NEXT_PUBLIC_POSTHOG_HOST }}' >> .env
echo 'VITE_POSTHOG_KEY=${{ secrets.NEXT_PUBLIC_POSTHOG_KEY }}' >> .env
echo 'VITE_POSTHOG_HOST=${{ secrets.NEXT_PUBLIC_POSTHOG_HOST }}' >> .env
echo 'VITE_SERVER_URL=${{ secrets.NEXT_PUBLIC_WEB_URL }}' >> .env
echo "NEXT_PUBLIC_CAP_AWS_REGION=${{ secrets.NEXT_PUBLIC_CAP_AWS_REGION }}" >> .env
echo "NEXT_PUBLIC_CAP_AWS_BUCKET=${{ secrets.NEXT_PUBLIC_CAP_AWS_BUCKET }}" >> .env
cat .env >> $GITHUB_ENV
- name: Run setup
shell: bash
run: node scripts/setup.js
- name: Run Clippy
uses: actions-rs-plus/clippy-check@v2
with:
args: --workspace --all-features --locked
lint-biome:
name: Lint (Biome)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Biome
uses: biomejs/setup-biome@v2
with:
version: latest
- name: Run Biome
run: biome ci . || true
build-desktop:
name: Build Desktop
strategy:
fail-fast: false
matrix:
settings:
- target: aarch64-apple-darwin
runner: macos-latest
- target: x86_64-pc-windows-msvc
runner: windows-latest
runs-on: ${{ matrix.settings.runner }}
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Rust setup
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.settings.target }}
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
shared-key: ${{ matrix.settings.target }}
- uses: ./.github/actions/setup-js
- name: Create .env file in root
run: |
echo "VITE_ENVIRONMENT=production" >> .env
echo "CAP_DESKTOP_SENTRY_URL=https://6a3b6a09e6ae976c2ad6fff710e88748@o4506859771527168.ingest.us.sentry.io/4508330917101568" >> .env
echo "NEXT_PUBLIC_WEB_URL=${{ secrets.NEXT_PUBLIC_WEB_URL }}" >> .env
echo 'NEXTAUTH_URL=${{ secrets.NEXT_PUBLIC_WEB_URL }}' >> .env
echo 'NEXT_PUBLIC_POSTHOG_KEY=${{ secrets.NEXT_PUBLIC_POSTHOG_KEY }}' >> .env
echo 'NEXT_PUBLIC_POSTHOG_HOST=${{ secrets.NEXT_PUBLIC_POSTHOG_HOST }}' >> .env
echo 'VITE_POSTHOG_KEY=${{ secrets.NEXT_PUBLIC_POSTHOG_KEY }}' >> .env
echo 'VITE_POSTHOG_HOST=${{ secrets.NEXT_PUBLIC_POSTHOG_HOST }}' >> .env
echo 'VITE_SERVER_URL=${{ secrets.NEXT_PUBLIC_WEB_URL }}' >> .env
echo "NEXT_PUBLIC_CAP_AWS_REGION=${{ secrets.NEXT_PUBLIC_CAP_AWS_REGION }}" >> .env
echo "NEXT_PUBLIC_CAP_AWS_BUCKET=${{ secrets.NEXT_PUBLIC_CAP_AWS_BUCKET }}" >> .env
- name: Copy .env to apps/desktop
run: cp .env apps/desktop/.env
- name: Output .env file
run: cat apps/desktop/.env
- name: Build app
working-directory: apps/desktop
run: |
pnpm -w cap-setup
pnpm tauri build --debug --target ${{ matrix.settings.target }} --no-bundle
env:
RUST_TARGET_TRIPLE: ${{ matrix.settings.target }}
tauri-plugins:
name: Verify Tauri plugin versions
runs-on: ubuntu-latest
needs: changes
if: needs.changes.outputs.tauri-plugins == 'true'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 20
- name: Run verify
shell: bash
run: node scripts/check-tauri-plugin-versions.js