Skip to content

feat: yki API version 2 #789

feat: yki API version 2

feat: yki API version 2 #789

Workflow file for this run

name: Build
on:
push:
branches:
- main
pull_request:
jobs:
submit_dependencies:
name: Submit dependencies
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Install tools
uses: jdx/mise-action@v2
with:
experimental: true
- name: Update dependency graph
uses: advanced-security/[email protected]
with:
directory: server
ignore-maven-wrapper: "true"
check_generated_sources:
name: Check generated sources
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install tools
uses: jdx/mise-action@v2
with:
experimental: true
- name: Generate sources
run: mvn generate-sources
working-directory: server
- name: Check for differences in generated sources
run: git diff --exit-code
server_tests:
name: Server tests
runs-on: ubuntu-latest
env:
MISE_ENV: ci
steps:
- uses: actions/checkout@v4
- name: Install tools
uses: jdx/mise-action@v2
with:
experimental: true
- name: Start DB
run: docker compose up -d db
- name: Build with Maven
run: mvn -B package --file pom.xml
working-directory: server
frontend_tests:
name: Frontend tests
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install tools
uses: jdx/mise-action@v2
with:
experimental: true
- name: Start DB
run: docker compose up -d db
working-directory: server
- name: Install dependencies
run: npm ci
working-directory: e2e
- name: Install Playwright Browsers
run: npx playwright install --with-deps
working-directory: e2e
- name: Build frontend
run: (chmod +x ./scripts/build_frontend.sh && ./scripts/build_frontend.sh)
- name: Run Playwright tests
run: npx playwright test
working-directory: e2e
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: e2e/playwright-report/
retention-days: 30
lint:
name: Check code formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install tools
uses: jdx/mise-action@v2
with:
experimental: true
- name: Check formatting
run: ./scripts/check-formatting.sh
build_image:
name: Build image
runs-on: ubuntu-latest
needs:
- deploy_util
- check_generated_sources
- submit_dependencies
- server_tests
- frontend_tests
- lint
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Install tools
uses: jdx/mise-action@v2
with:
experimental: true
- name: Log in to utility account
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: eu-west-1
role-to-assume: arn:aws:iam::961341524988:role/kitu-github-actions-role
- uses: aws-actions/amazon-ecr-login@v2
id: login-ecr
- uses: docker/setup-buildx-action@v3
- uses: docker/build-push-action@v6
with:
push: ${{ github.ref_name == 'main' }}
tags: ${{ steps.login-ecr.outputs.registry }}/kitu:${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
deploy_util:
name: Util
uses: ./.github/workflows/_deploy-env.yml
with:
environment: Util
action: ${{ github.ref_name == 'main' && 'deploy' || 'diff' }}
deploy_dev:
name: Dev
needs:
- build_image
uses: ./.github/workflows/_deploy-env.yml
with:
environment: Dev
action: ${{ github.ref_name == 'main' && 'deploy' || 'diff' }}
deploy_test:
name: Test
needs: deploy_dev
uses: ./.github/workflows/_deploy-env.yml
with:
environment: Test
action: ${{ github.ref_name == 'main' && 'deploy' || 'diff' }}
deploy_prod:
name: Prod
needs: deploy_test
uses: ./.github/workflows/_deploy-env.yml
with:
environment: Prod
action: ${{ github.ref_name == 'main' && 'deploy' || 'diff' }}