diff --git a/.github/workflows/backend_build_and_test.yml b/.github/workflows/backend_build_and_test.yml index bfdd07d..2a7b908 100644 --- a/.github/workflows/backend_build_and_test.yml +++ b/.github/workflows/backend_build_and_test.yml @@ -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 & diff --git a/.github/workflows/frontend_build.yml b/.github/workflows/frontend_build.yml new file mode 100644 index 0000000..52f00d7 --- /dev/null +++ b/.github/workflows/frontend_build.yml @@ -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 diff --git a/README.md b/README.md index ee783c0..afbe85a 100644 --- a/README.md +++ b/README.md @@ -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) +