-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6f41766
commit 4c7adee
Showing
5 changed files
with
79 additions
and
68 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Run Test Services | ||
description: Imports built Docker images, starts docker-compose-test, and migrates database | ||
inputs: | ||
image-from-artifacts: | ||
description: If true, download images from GHA artifacts | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Download built images | ||
if: ${{ inputs.image-from-artifacts == "true" }} | ||
uses: actions/download-artifact@v4 | ||
with: | ||
pattern: docker-* | ||
path: /tmp | ||
merge-multiple: true | ||
|
||
- name: Import images | ||
if: ${{ inputs.image-from-artifacts == "true" }} | ||
run: for f in /tmp/*.tar; do docker load -i $f; done | ||
shell: bash | ||
|
||
- name: Set ref in docker-compose | ||
run: sed -i "s/__RC_REF__/${{ github.ref_name }}/g" docker-compose-test.yml | ||
shell: bash | ||
|
||
- name: Docker Compose | ||
uses: hoverkraft-tech/[email protected] | ||
with: | ||
compose-file: | | ||
docker-compose.yml | ||
docker-compose-test.yml | ||
- name: Migrate database | ||
run: | | ||
yarn prisma:migrateProd | ||
shell: bash | ||
|
||
- name: Restart services | ||
run: | | ||
docker compose -f docker-compose.yml -f docker-compose-test.yml restart server jobrunner | ||
shell: bash |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -128,9 +128,19 @@ jobs: | |
token: ${{ secrets.CODECOV_TOKEN }} | ||
files: ./server/coverage/coverage-final.json,./jobrunner/coverage/coverage-final.json | ||
|
||
build: | ||
uses: ./.github/workflows/build_shared.yml | ||
with: | ||
ref: ${{ github.ref }} | ||
tag: ${{ github.ref_name }} | ||
multi_arch: false | ||
push_docker: false | ||
export_artifacts: true | ||
|
||
test-e2e-server: | ||
timeout-minutes: 60 | ||
runs-on: ubuntu-latest | ||
needs: [build] | ||
env: | ||
NODE_ENV: test | ||
E2E_TEST: "true" | ||
|
@@ -144,33 +154,17 @@ jobs: | |
cache: "yarn" | ||
cache-dependency-path: "yarn.lock" | ||
|
||
- name: Docker Compose | ||
uses: hoverkraft-tech/[email protected] | ||
|
||
- name: Install dependencies | ||
run: yarn install --immutable --inline-builds | ||
|
||
- name: Build server | ||
run: | | ||
yarn build | ||
cp -r public .next/standalone/server/public | ||
mkdir -p .next/standalone/server/.next | ||
cp -r .next/static .next/standalone/server/.next/static | ||
working-directory: ./server | ||
|
||
- name: Build Jobrunner | ||
run: | | ||
yarn build | ||
cp ../utility/prisma/schema.prisma . | ||
working-directory: ./jobrunner | ||
- uses: ./.github/steps/run-test-services | ||
with: | ||
image-from-artifacts: "true" | ||
|
||
- uses: ./.github/steps/setup-playwright | ||
with: | ||
working-directory: ./server | ||
|
||
- name: Migrate database | ||
run: yarn prisma:migrateProd | ||
|
||
- name: Run Playwright tests | ||
run: yarn ${{ runner.debug && 'test:e2e:debug' || 'test:e2e' }} | ||
working-directory: ./server | ||
|
@@ -231,6 +225,7 @@ jobs: | |
test-e2e-desktop-complete: | ||
timeout-minutes: 60 | ||
runs-on: ubuntu-latest | ||
needs: [build] | ||
env: | ||
NODE_ENV: test | ||
E2E_TEST: "true" | ||
|
@@ -245,52 +240,20 @@ jobs: | |
cache: "yarn" | ||
cache-dependency-path: "yarn.lock" | ||
|
||
- name: Docker Compose | ||
uses: hoverkraft-tech/[email protected] | ||
|
||
- name: Install dependencies | ||
run: yarn install --immutable --inline-builds | ||
|
||
- uses: FedericoCarboni/setup-ffmpeg@v3 | ||
- uses: ./.github/steps/run-test-services | ||
with: | ||
ffmpeg-version: "release" | ||
|
||
- name: Build server | ||
run: | | ||
yarn build | ||
cp -r public .next/standalone/server/public | ||
mkdir -p .next/standalone/server/.next | ||
cp -r .next/static .next/standalone/server/.next/static | ||
working-directory: ./server | ||
|
||
- name: Build Jobrunner | ||
run: | | ||
yarn build | ||
cp ../utility/prisma/schema.prisma . | ||
working-directory: ./jobrunner | ||
image-from-artifacts: "true" | ||
|
||
- name: Build desktop | ||
run: yarn build | ||
working-directory: ./desktop | ||
|
||
- name: Migrate database | ||
run: yarn prisma:migrateProd | ||
|
||
- name: Make logs folder | ||
run: mkdir -p ${{ runner.temp }}/logs | ||
|
||
- name: Start Jobrunner | ||
run: | | ||
node --enable-source-maps dist/index.cjs --watch --pidFile ${{ runner.temp }}/jobrunner.pid > ${{ runner.temp }}/logs/jobrunner.log 2>&1 & | ||
npx -y wait-on file:/${{ runner.temp }}/jobrunner.pid | ||
working-directory: ./jobrunner | ||
|
||
- name: Start server | ||
run: | | ||
HOSTNAME=localhost node server/server.js > ${{ runner.temp }}/logs/server.log 2>&1 & | ||
npx -y wait-on -v -t 120000 http://localhost:3000/api/healthz | ||
working-directory: ./server/.next/standalone | ||
|
||
- name: Run Playwright tests | ||
run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- yarn ${{ runner.debug && 'test:e2e:debug' || 'test:e2e' }} --project complete | ||
working-directory: ./desktop | ||
|
File renamed without changes.