add fontend action

This commit is contained in:
S. F. Jakobsen 2025-03-22 02:12:12 +01:00 committed by sfja
parent b852cae890
commit f4fbda226a
3 changed files with 60 additions and 12 deletions

View File

@ -1,10 +1,16 @@
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'
@ -17,9 +23,9 @@ jobs:
working-directory: ./backend
steps:
- uses: actions/checkout@v4
- name: build release with tests
- name: Build debug with tests
run: make -B INCLUDE_TESTS=1
- name: run tests
- name: Run tests
run: ./build/server --run-tests
build_release:
@ -29,9 +35,9 @@ jobs:
working-directory: ./backend
steps:
- uses: actions/checkout@v4
- name: build release with tests
- name: Build release with tests
run: make -B RELEASE=1 INCLUDE_TESTS=1
- name: run tests
- name: Run tests
run: ./build/server --run-tests
test_debug:
@ -44,13 +50,13 @@ jobs:
- uses: denoland/setup-deno@v2
with:
deno-version: v2.x
- name: cache dependencies
- name: Cache dependencies
run: deno cache --check test/test.ts
- name: build release with tests
- name: Build with tests
run: make -B
- name: setup database
- name: Setup database
run: make drop_database
- name: test
- name: Run tests
timeout-minutes: 1
run: |
./build/server &
@ -67,13 +73,13 @@ jobs:
- uses: denoland/setup-deno@v2
with:
deno-version: v2.x
- name: cache dependencies
- name: Cache dependencies
run: deno cache --check test/test.ts
- name: build release with tests
- name: Build release with tests
run: make -B RELEASE=1
- name: setup database
- name: Setup database
run: make drop_database
- name: test
- name: Run tests
timeout-minutes: 1
run: |
./build/server &

39
.github/workflows/frontend_build.yml vendored Normal file
View File

@ -0,0 +1,39 @@
name: "Frontend: Build"
on:
workflow_dispatch:
push:
branches: [ "main" ]
paths:
- 'mobile/**'
pull_request:
branches: [ "main" ]
paths:
- 'mobile/**'
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./mobile
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Setup Flutter
uses: subosito/flutter-action@v2
id: flutter-action
with:
# channel: stable
flutter-version: 3.29.2
- name: Install Linux Dependencies
run: sudo apt-get install -y ninja-build libgtk-3-dev
- name: Turn off CLI animations
run: flutter config --no-cli-animations
- name: Install packages
run: flutter pub get
- name: Build Linux
run: flutter build linux --verbose
- name: Build Web
run: flutter build web --verbose

View File

@ -3,3 +3,6 @@
Af [M. T. Kongsted](@mtkonge) og [S. F. Jakobsen](@SimonFJ20)
[![Backend: Build and Test](https://github.com/Mercantec-GHC/h4-projekt-gruppe-0-sm/actions/workflows/backend_build_and_test.yml/badge.svg)](https://github.com/Mercantec-GHC/h4-projekt-gruppe-0-sm/actions/workflows/backend_build_and_test.yml)
[![Frontend: Build](https://github.com/Mercantec-GHC/h4-projekt-gruppe-0-sm/actions/workflows/frontend_build.yml/badge.svg)](https://github.com/Mercantec-GHC/h4-projekt-gruppe-0-sm/actions/workflows/frontend_build.yml)