Skip to content

SY-1254 Labjack reads #501

SY-1254 Labjack reads

SY-1254 Labjack reads #501

Workflow file for this run

name: "Test - Migration"
on:
pull_request:
branches: [rc, main]
push:
branches: [rc]
workflow_dispatch:
permissions:
contents: write
packages: write
jobs:
setup:
runs-on: ubuntu-latest
outputs:
changed: ${{ steps.filter.outputs.changed }}
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Diff Changes
uses: dorny/paths-filter@v3
id: filter
with:
filters: |
changed:
- "client/**"
- "freighter/py/**"
- "synnax/**"
- "cesium/**"
- "aspen/**"
- "x/**"
- "freighter/**"
- ".github/workflows/test.client.yaml"
- ".github/workflows/test.migration.yaml"
test-on-both-servers:
needs: setup
runs-on: ubuntu-latest
if: needs.setup.outputs.changed == 'true'
steps:
- name: Checkout Repository
uses: actions/checkout@v3
# Test with Main Server
- name: Start Main Server
run: docker run -d --name synnax-main -p 9090:9090 -v data:/usr/local/synnax/data -e SYNNAX_DATA=/usr/local/synnax/data -e SYNNAX_LISTEN=0.0.0.0:9090 -e SYNNAX_VERBOSE=true -e SYNNAX_INSECURE=true -e SYNNAX_MEM=false -e SYNNAX_LICENSE_KEY=${{ secrets.SYNNAX_LICENSE_KEY }} ghcr.io/synnaxlabs/synnax:latest
- name: Checkout Main Branch for Tests
uses: actions/checkout@v3
with:
ref: main
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Install Poetry
run: |
pip install poetry
poetry config virtualenvs.create false
poetry install
poetry shell
working-directory: ./client/py
- name: Python Test with Main Server
run: pytest --cov=freighter --cov-report xml:coverage.xml
working-directory: ./client/py
- name: Exit Poetry Shell
run: exit
working-directory: ./client/py
- name: Stop Main Server
run: docker stop synnax-main && docker rm synnax-main
# Build and Test with Current Server
- name: Checkout Current Branch
uses: actions/checkout@v3
- name: Login to Github Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Download Latest Earthly
uses: earthly/actions-setup@v1
- name: Build Current Server Image
run: earthly --push +docker -tag=${GITHUB_SHA} -driver=false
working-directory: ./synnax
- name: Push Current Server Image to Github Container Registry
run: docker push ghcr.io/synnaxlabs/synnax:${GITHUB_SHA}
- name: Start Current Server
run: docker run -d --name synnax-current -p 9090:9090 -v data:/usr/local/synnax/data -e SYNNAX_DATA=/usr/local/synnax/data -e SYNNAX_LISTEN=0.0.0.0:9090 -e SYNNAX_VERBOSE=true -e SYNNAX_INSECURE=true -e SYNNAX_MEM=false -e SYNNAX_LICENSE_KEY=${{ secrets.SYNNAX_LICENSE_KEY }} ghcr.io/synnaxlabs/synnax:${GITHUB_SHA}
- name: Install Poetry
run: |
pip install poetry
poetry config virtualenvs.create false
poetry install
poetry shell
working-directory: ./client/py
- name: Python Test with Current Server
run: pytest --cov=freighter --cov-report xml:coverage.xml
working-directory: ./client/py
- name: Stop Current Server
run: docker stop synnax-current && docker rm synnax-current