-
Notifications
You must be signed in to change notification settings - Fork 20
93 lines (92 loc) · 3.31 KB
/
ci.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
93
name: Continuous Integration
on:
push:
branches:
- main
pull_request:
jobs:
code_tests:
name: Code tests
runs-on: ubuntu-22.04
env:
NIX_BUILD_SHELL: bash
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: ./.github/actions/setup
- name: Run tests
run: nix-shell --command "scripts/test.sh"
integration_tests:
name: Integration tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-11, ubuntu-22.04]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: ./.github/actions/setup
- name: Setup git
run: |
git config --global user.email "[email protected]"
git config --global user.name "Example"
- name: Create test project
run: |
scripts/script-create-django-app.sh --name integration
- name: Run tests
run: |
cd integration
nix-shell --command "python manage.py generate_client_assets"
nix-shell --command "python manage.py build"
nix-shell --command "scripts/test.sh"
nix-shell --command "scripts/remove_example.sh"
nix-shell --command "python manage.py generate_client_assets"
nix-shell --command "python manage.py build"
nix-shell --command "scripts/test.sh"
website_tests:
name: Website tests
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: ./.github/actions/setup
- name: Run tests
run: |
cd website
nix-shell --command "python manage.py generate_client_assets"
nix-shell --command "scripts/test.sh --all"
- name: Run build
if: github.repository_owner == github.actor
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
run: |
cd website
scripts/deploy.sh --build-only
docker_tests:
name: Docker tests
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: ./.github/actions/setup
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
# Note that we do not log in for tests, as forks cannot access credentials
- name: "Prepare docker context"
run: scripts/build-create-django-app-docker.sh
- name: Build and push
uses: docker/build-push-action@v2
with:
context: website_build_context
platforms: linux/amd64,linux/arm64
file: website_build_context/Dockerfile
push: false
cache-from: type=gha
cache-to: type=gha,mode=max
tags: silviogutierrez/reactivated:ci