-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (64 loc) · 1.92 KB
/
test.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
name: Lint and Test code
on:
pull_request:
push:
branches: [main, develop]
jobs:
test:
runs-on: arc-runner-set # K8s self hosted runner
env:
DJANGO_SETTINGS_MODULE: hip.settings.dev
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: hip_ci
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16'
- name: Cache node modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- run: npm install
- run: npm run build
- uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'
cache-dependency-path: 'requirements/*/**.txt'
- name: Cache pre-commit
uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: ${{ runner.os }}-precommit-${{ hashFiles('.pre-commit-config.yaml') }}
restore-keys: |
${{ runner.os }}-precommit-
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel pip-tools
pip-sync requirements/base/base.txt requirements/dev/dev.txt
- uses: pre-commit/[email protected]
- name: Run Tests
run: make run-tests
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/hip_ci
- name: Test build deploy image
run: inv image.build