SY-930 add console tests to ci #4
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Test - Pluto" | ||
on: | ||
pull_request: | ||
branches: | ||
- rc | ||
- main | ||
push: | ||
branches: | ||
- rc | ||
- main | ||
workflow_dispatch: | ||
env: | ||
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} | ||
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
- name: Diff Changes | ||
uses: dorny/paths-filter@v3 | ||
id: filter | ||
with: | ||
base: ${{ github.ref }} | ||
filters: | | ||
changed: | ||
- "console/**" | ||
- "pluto/**" | ||
- "client/ts/**" | ||
- "freighter/ts/**" | ||
- "x/ts/**" | ||
- ".github/workflows/test.console.yaml" | ||
- name: Set up pnpm | ||
if: steps.filter.outputs.changed == 'true' | ||
uses: pnpm/action-setup@v3 | ||
with: | ||
version: 9 | ||
- name: Set up Node | ||
if: steps.filter.outputs.changed == 'true' | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: pnpm | ||
- name: Install Dependencies | ||
if: steps.filter.outputs.changed == 'true' | ||
run: pnpm install --frozen-lockfile | ||
build-tauri: | ||
needs: setup | ||
if: needs.setup.outputs.changed == 'true' | ||
env: | ||
SYNNAX_TS_ENV: prod | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
platform: [ macos-12, windows-latest ] | ||
runs-on: ${{ matrix.platform }} | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
- name: Setup pnpm | ||
uses: pnpm/action-setup@v3 | ||
with: | ||
version: 9 | ||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: "pnpm" | ||
- name: Adjust Auto Updater URL for Release Candidate | ||
if: github.event_name == 'push' && github.ref == 'refs/heads/rc' | ||
working-directory: ./console/src-tauri | ||
run: | | ||
jq '.plugins.updater.endpoints = ["https://raw.githubusercontent.com/synnaxlabs/synnax/rc/console/release-spec.json"]' tauri.conf.json > temp.json | ||
rm tauri.conf.json | ||
mv temp.json tauri.conf.json | ||
- name: Install Rust Stable | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
- name: Rust Cache | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
workspaces: console/src-tauri -> target | ||
key: ${{ runner.os }} | ||
- name: Turbo Cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: .turbo-cache | ||
key: ${{ runner.os }}-turbo-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-turbo- | ||
- name: Install Dependencies | ||
run: pnpm i | ||
- name: Build Pluto | ||
if: needs.setup.outputs.changed == 'true' | ||
run: pnpm build:pluto | ||
- name: Build Drift | ||
if: needs.setup.outputs.changed == 'true' | ||
run: pnpm build:drift | ||
# We need to build the console separately WITHOUT turbo repo because of strange | ||
# incompatibility issues with rust builds. | ||
- name: Build Console | ||
if: needs.setup.outputs.changed == 'true' | ||
env: | ||
NODE_OPTIONS: "--max_old_space_size=4096" | ||
working-directory: ./console | ||
run: pnpm build | ||
- name: Test | ||
if: steps.filter.outputs.changed == 'true' | ||
run: pnpm test:console | ||