-
Notifications
You must be signed in to change notification settings - Fork 1
92 lines (74 loc) · 1.88 KB
/
main.yaml
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
name: Quality and Build
on:
pull_request:
branches: [main]
types: [opened, synchronize, reopened, labeled]
push:
branches: [main]
env:
REGISTRY: ghcr.io
jobs:
lint:
runs-on: ubuntu-20.04
name: Linting
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.7.1'
- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install dependencies
run: |
node -v && yarn -v && yarn install --immutable && \
git status
- name: Prettier
run: |
yarn format:check
- name: Linting
run: |
yarn lint:check
test:
runs-on: ubuntu-20.04
name: Testing
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.7.1'
- uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install dependencies
run: |
node -v && yarn -v && yarn install --immutable && \
git status
- name: NestJS build
run: |
yarn build
- name: Unit testing
run: |
yarn test
- name: End-to-end testing
run: |
yarn test:e2e
build:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: [lint, test]
runs-on: ubuntu-20.04
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Build Docker image
uses: ./.github/actions/docker-build
with:
registry: ${{ env.REGISTRY }}
image_name: "${{ github.repository }}/server"
context: ./
dockerfile: "Dockerfile"
docker_user: ${{ github.actor }}
docker_password: ${{ secrets.GITHUB_TOKEN }}