-
Notifications
You must be signed in to change notification settings - Fork 1
88 lines (80 loc) · 2.55 KB
/
test-code.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
# This workflow is to run all tests that don't require containers to be built
name: Test BCIERS code
on:
workflow_call:
env:
PGUSER: postgres
DJANGO_SECRET_KEY: ${{ secrets.DJANGO_SECRET_KEY }}
KEYCLOAK_CLIENT_ID: ${{ secrets.KEYCLOAK_CLIENT_ID }}
KEYCLOAK_CLIENT_SECRET: ${{ secrets.KEYCLOAK_CLIENT_SECRET }}
NEXTAUTH_SECRET: ${{ secrets.NEXTAUTH_SECRET }}
jobs:
nx-tests:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./bciers
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: dev env setup
uses: ./.github/actions/dev-env-setup
- name: Run Nx Affected Tests with Remote Caching
id: nx-tests
run: |
yarn nx affected --base=origin/develop --target=test --parallel
shell: bash
yarn-audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: dev env setup
uses: ./.github/actions/dev-env-setup
- run: yarn npm audit --exclude eslint
working-directory: ./bciers
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: dev env setup
uses: ./.github/actions/dev-env-setup
- name: set pre-commit cache directory
run: |
echo "PRE_COMMIT_HOME=$GITHUB_WORKSPACE/.pre-commit-cache" >> $GITHUB_ENV
- name: set PY
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
- name: create commitlint COMMIT_EDITMSG if not exists
run: |
if test -f ".git/COMMIT_EDITMSG"; then
echo "COMMIT_EDITMSG EXISTS, skipping"
else
touch .git/COMMIT_EDITMSG
fi
- uses: actions/cache@v4
with:
path: |
./.pre-commit-cache
key: pre-commit-${{ env.PY }}-${{ hashFiles('.pre-commit-config.yaml') }}-v4
- run: pip install -r requirements.txt
- uses: pre-commit/action@v3.0.1
check-migrations:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: dev env setup
uses: ./.github/actions/dev-env-setup
- run: poetry run python manage.py makemigrations --check --dry-run
working-directory: ./bc_obps
check-test-data:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: dev env setup
uses: ./.github/actions/dev-env-setup
- name: Run Migrations
run: make migrate
working-directory: ./bc_obps
- run: make load_test_data
working-directory: ./bc_obps