-
Notifications
You must be signed in to change notification settings - Fork 48
78 lines (74 loc) · 2.07 KB
/
pull-request.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
name: Anubis Pull Request CD/CI
on:
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
# Test Stage.
test-api:
name: Test api
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: api
strategy:
matrix:
python-version: [ '3.10' ]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v3
id: cache-venv # name for referring later
with:
path: |
**/venv
key: ${{ runner.os }}-venv-${{ hashFiles('**/api/requirements/dev.txt') }}
- name: Install dependencies
run: |
set -ex
python -m venv venv
if [ -f requirements/dev.txt ]; then ./venv/bin/pip install -r requirements/dev.txt; fi
if: steps.cache-venv.outputs.cache-hit != 'true'
- name: Background API
run: |
set -ex
docker run -itd -p 6379:6379 redis redis-server --requirepass anubis
env MINDEBUG=1 MIGRATE=1 ./venv/bin/python3 dev.py &
- name: Test with pytest
run: |
./tests/mintest.sh
- name: Teardown
run: |
killall -9 python3
test-web:
name: test web
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: web
strategy:
matrix:
node-version: [ 16.x ]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- uses: actions/cache@v3
id: yarn-cache
with:
path: |
**/node_modules
**/.eslintcache
${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn install --frozen-lockfile
- run: env DISABLE_ESLINT_PLUGIN=true yarn run build