-
Notifications
You must be signed in to change notification settings - Fork 32
78 lines (76 loc) · 2.4 KB
/
main.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: Test cookiecutter scaffolder
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: "actions/setup-python@v4"
with:
python-version: "3.10"
- name: Install cookiecutter
run: |
python -m pip install --upgrade pip
pip install cookiecutter
- name: Run cookiecutter
run: |
set -x
rm -rf Company-Project
cookiecutter . --no-input
- name: Archive generated-project
uses: actions/upload-artifact@v3
with:
name: generated-project
path: ./Company-Project
retention-days: 1
backend:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rm -rf Company-Project
- name: Restore generated-project
uses: actions/download-artifact@v3
with:
name: generated-project
path: Company-Project
- name: Create docker-compose config for running boilerplate tests
run: |
cp docker-compose-circleci.yml Company-Project/docker-compose-circleci.yml
- name: Build image
run: |
cd Company-Project
chmod +x src/docker-entrypoint.sh
docker-compose -f docker-compose-circleci.yml build
- name: Verify backend scaffolder
run: |
cd Company-Project
set -x
docker-compose -f docker-compose-circleci.yml run --rm python python manage.py new_page --name=Article
- name: Run tests on container
run: |
cd Company-Project
docker-compose -f docker-compose-circleci.yml run --rm python test
docker-compose -f docker-compose-circleci.yml run --rm python typecheck
docker-compose -f docker-compose-circleci.yml run --rm python lint
frontend:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: "actions/setup-node@v4"
with:
node-version: "20"
- run: rm -rf Company-Project
- name: Restore generated-project
uses: actions/download-artifact@v3
with:
name: generated-project
path: Company-Project
- name: Run frontend tests
run: |
cd Company-Project/frontend
npm ci
npm run test:ci
IGNORE_SENTRY=1 npm run build
npm run build-storybook