-
Notifications
You must be signed in to change notification settings - Fork 0
110 lines (103 loc) · 3.17 KB
/
main-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: Main CI
on:
pull_request:
types: [opened, reopened, synchronize]
workflow_dispatch:
push:
branches:
- develop
env:
TAG: ${{ github.head_ref || github.ref_name }} | tr '/' '-'
jobs:
pre-commit-check:
name: Check pre-commit hooks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Pre-commit
run: pip install pre-commit
- name: Install Prettier
working-directory: frontend
run: |
npm ci
npm run format-check
- run: pre-commit run --all-files
build-backend:
name: Build Backend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: ./backend
push: true
tags: ghcr.io/dnum-mi/basegun/basegun-backend:${{ env.TAG }}
build-frontend:
name: Build Frontend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: ./frontend
push: true
tags: ghcr.io/dnum-mi/basegun/basegun-frontend:${{ env.TAG }}
test-backend:
name: Test Backend
needs: build-backend
runs-on: ubuntu-latest
container:
image: ghcr.io/dnum-mi/basegun/basegun-backend:${{ env.TAG }}
env:
AWS_REGION: gra
AWS_DEFAULT_REGION: gra
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
S3_URL_ENDPOINT: https://s3.gra.io.cloud.ovh.net/
S3_BUCKET_NAME: basegun-s3
EMAIL_HOST: mailpit
EMAIL_PORT: 1025
OIDC_CONFIG_URL: https://token.actions.githubusercontent.com/.well-known/openid-configuration
OIDC_JWKS_URL: https://token.actions.githubusercontent.com/.well-known/jwks
OIDC_JWKS_KID: cc413527-173f-5a05-976e-9c52b1d7b431
OIDC_CLIENT_ID: basegun
steps:
- run: cd /app && pytest
services:
mailpit:
image: axllent/mailpit
ports:
- 1025:1025
env:
MP_SMTP_AUTH_ACCEPT_ANY: 1
MP_SMTP_AUTH_ALLOW_INSECURE: 1
test-frontend-format:
name: Test Frontend Formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run Prettier check
working-directory: frontend
run: |
npm ci
npm run format-check
test-e2e:
name: Run E2E tests
needs: [build-backend, build-frontend]
uses: ./.github/workflows/test-e2e.yml