-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: extract jobs from main build workflow
- Loading branch information
Showing
4 changed files
with
116 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,42 @@ | ||
name: Build Image | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
github_ref_name: | ||
type: string | ||
github_sha: | ||
type: string | ||
secrets: | ||
GITHUB_TOKEN: | ||
required: true | ||
|
||
jobs: | ||
build_image: | ||
name: Build image | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
contents: read | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install tools | ||
uses: jdx/mise-action@v2 | ||
with: | ||
experimental: true | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- 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: ${{ inputs.github_ref_name == 'main' }} | ||
tags: ${{ steps.login-ecr.outputs.registry }}/kitu:${{ inputs.github_sha }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
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,39 @@ | ||
name: Frontend Tests | ||
|
||
on: | ||
workflow_call: | ||
secrets: | ||
GITHUB_TOKEN: | ||
required: true | ||
|
||
jobs: | ||
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 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- 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: 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 |
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,25 @@ | ||
name: Server Tests | ||
|
||
on: | ||
workflow_call: | ||
secrets: | ||
GITHUB_TOKEN: | ||
required: true | ||
|
||
jobs: | ||
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 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build with Maven | ||
run: mvn -B package --file pom.xml | ||
working-directory: server |
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