Skip to content

SY-1375 Run CI on Windows and macOS #2025

SY-1375 Run CI on Windows and macOS

SY-1375 Run CI on Windows and macOS #2025

Workflow file for this run

name: Test - Client
on:
push:
branches:
- main
- rc
pull_request:
branches:
- main
- rc
workflow_dispatch:
permissions:
contents: write
packages: write
jobs:
changes:
name: Changes
runs-on: ubuntu-latest
outputs:
server: ${{ steps.filter.outputs.server }}
cpp: ${{ steps.filter.outputs.cpp }}
py: ${{ steps.filter.outputs.py }}
ts: ${{ steps.filter.outputs.ts }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Diff Changes
uses: dorny/paths-filter@v3
id: filter
with:
base: ${{ github.ref }}
filters: |
shared: &shared
- .github/workflows/test.client.yaml
server: &server
- *shared
- alamos/go/**
- aspen/**
- cesium/**
- freighter/go/**
- synnax/**
- x/go/**
cpp:
- *shared
- *server
- client/cpp/**
- freighter/cpp/**
py:
- *shared
- *server
- alamos/py/**
- client/py/**
- freighter/py/**
ts:
- *shared
- *server
- alamos/ts/**
- client/ts/**
- configs/eslint/**
- configs/ts/**
- configs/vite/**
- freighter/ts/**
- x/ts/**
server:
name: Server
needs: changes
runs-on: ubuntu-latest
if: needs.changes.outputs.cpp == 'true' || needs.changes.outputs.py == 'true' || needs.changes.outputs.ts == 'true'
env:
GITHUB_SHA: ${{ github.sha }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Login to Github Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Download Earthly
uses: earthly/actions-setup@v1
- name: Build Image
run: earthly --push +docker -tag=${GITHUB_SHA} -driver=false
working-directory: synnax
- name: Push to Github Container Registry
run: docker push ghcr.io/synnaxlabs/synnax:${GITHUB_SHA}
cpp:
name: C++
needs: [changes, server]
if: needs.changes.outputs.cpp == 'true'
runs-on: ubuntu-latest
services:
synnax:
image: ghcr.io/synnaxlabs/synnax:${{ github.sha }}
env:
SYNNAX_LISTEN: localhost:9090
SYNNAX_VERBOSE: true
SYNNAX_INSECURE: true
SYNNAX_MEM: true
SYNNAX_LICENSE_KEY: ${{ secrets.SYNNAX_LICENSE_KEY }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
ports:
- 9090:9090
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Bazel
uses: bazel-contrib/setup-bazel@0.8.1
with:
bazelisk-cache: true
disk-cache: ${{ github.workflow }}
repository-cache: true
- name: Test
run: bazel test --test_output=all //client/... --nocache_test_results
py:
name: Python
needs: [changes, server]
if: needs.changes.outputs.py == 'true'
runs-on: ubuntu-latest
services:
synnax:
image: ghcr.io/synnaxlabs/synnax:${{ github.sha }}
env:
SYNNAX_LISTEN: localhost:9090
SYNNAX_VERBOSE: true
SYNNAX_INSECURE: true
SYNNAX_MEM: true
SYNNAX_LICENSE_KEY: ${{ secrets.SYNNAX_LICENSE_KEY }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
ports:
- 9090:9090
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Poetry
run: pipx install poetry
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: client/py/pyproject.toml
cache: poetry
- name: Install Dependencies
run: poetry install
working-directory: client/py
- name: Test
run: poetry run pytest
working-directory: client/py
ts:
name: TypeScript
needs: [changes, server]
if: needs.changes.outputs.ts == 'true'
runs-on: ubuntu-latest
services:
synnax:
image: ghcr.io/synnaxlabs/synnax:${{ github.sha }}
env:
SYNNAX_LISTEN: localhost:9090
SYNNAX_VERBOSE: true
SYNNAX_INSECURE: true
SYNNAX_MEM: true
SYNNAX_LICENSE_KEY: ${{ secrets.SYNNAX_LICENSE_KEY }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
ports:
- 9090:9090
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up pnpm
uses: pnpm/action-setup@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: package.json
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
- name: Install Dependencies
run: pnpm install
- name: Build
run: pnpm build:client
- name: Test
run: pnpm test:client
- name: Lint
run: pnpm lint:client