mirror of
https://github.com/Mercantec-GHC/h4-projekt-gruppe-0-sm.git
synced 2025-04-27 16:24:07 +02:00
102 lines
2.3 KiB
YAML
102 lines
2.3 KiB
YAML
name: "Backend: Build and Test"
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
|
|
push:
|
|
branches: [ "main" ]
|
|
paths:
|
|
- 'backend/**'
|
|
pull_request:
|
|
branches: [ "main" ]
|
|
paths:
|
|
- 'backend/**'
|
|
|
|
env:
|
|
BACKEND_SERVER_HOSTNAME: 'http://localhost:8080'
|
|
|
|
jobs:
|
|
build_debug:
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: ./backend
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: denoland/setup-deno@v2
|
|
with:
|
|
deno-version: v2.x
|
|
- name: Install nasm
|
|
run: sudo apt-get install nasm
|
|
- name: Build debug with tests
|
|
run: make -B INCLUDE_TESTS=1
|
|
- name: Run tests
|
|
run: ./build/server --run-tests
|
|
|
|
build_release:
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: ./backend
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: denoland/setup-deno@v2
|
|
with:
|
|
deno-version: v2.x
|
|
- name: Install nasm
|
|
run: sudo apt-get install nasm
|
|
- name: Build release with tests
|
|
run: make -B RELEASE=1 INCLUDE_TESTS=1
|
|
- name: Run tests
|
|
run: ./build/server --run-tests
|
|
|
|
test_debug:
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: ./backend
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: denoland/setup-deno@v2
|
|
with:
|
|
deno-version: v2.x
|
|
- name: Install nasm
|
|
run: sudo apt-get install nasm
|
|
- name: Cache dependencies
|
|
run: deno cache --check test/test.ts
|
|
- name: Build with tests
|
|
run: make -B
|
|
- name: Setup database
|
|
run: make drop_database
|
|
- name: Run tests
|
|
timeout-minutes: 1
|
|
run: |
|
|
./build/server &
|
|
sleep 1
|
|
deno test --allow-env --allow-net test/test.ts
|
|
|
|
test_release:
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: ./backend
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: denoland/setup-deno@v2
|
|
with:
|
|
deno-version: v2.x
|
|
- name: Install nasm
|
|
run: sudo apt-get install nasm
|
|
- name: Cache dependencies
|
|
run: deno cache --check test/test.ts
|
|
- name: Build release with tests
|
|
run: make -B RELEASE=1
|
|
- name: Setup database
|
|
run: make drop_database
|
|
- name: Run tests
|
|
timeout-minutes: 1
|
|
run: |
|
|
./build/server &
|
|
sleep 1
|
|
deno test --allow-env --allow-net test/test.ts
|