-
Notifications
You must be signed in to change notification settings - Fork 12
93 lines (85 loc) · 2.73 KB
/
web.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: Python package
on:
push:
branches:
- master
- dev
pull_request:
jobs:
django:
runs-on: ubuntu-latest
strategy:
matrix:
python:
# - 3.6
- "3.10"
django:
# - "==2.2.*"
- "==3.2.*"
steps:
- uses: actions/checkout@v3
# Pull the latest image to build, and avoid caching pull-only images.
# (docker pull is faster than caching in most cases.)
- run: |
docker-compose --file docker-compose.yml --file docker-compose.test.yml pull
docker pull python:${{matrix.python}}-slim
# In this step, this action saves a list of existing images,
# the cache is created without them in the post run.
# - uses: satackey/[email protected]
# # Ignore the failure of a step and avoid terminating the job.
# continue-on-error: true
# with:
# key: python-${{ matrix.python }}-${{ matrix.django }}-{hash}
# restore-keys: |
# python-${{ matrix.python }}-${{ matrix.django }}-
- name: Start database early
run: docker-compose up -d db
- name: Build application
run: make build
env:
PYTHON_VERSION: ${{ matrix.python }}
- name: Migration check
run: make check
- name: Show settings
run: make settings
- name: Run unit tests
run: make test
- name: Run e2e tests
run: make e2e
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: docker-compose pull
# - uses: satackey/[email protected]
# continue-on-error: true
- name: Build application
run: make build
- name: Build documentation
run: make docs
# build-and-push:
# runs-on: ubuntu-latest
# # needs:
# # - test_web
# steps:
# - name: Checkout code
# uses: actions/checkout@v3
# - name: Get version from script
# id: get_version
# working-directory: /code/poradnia
# run: echo "::set-output name=version::$(python version.py)"
# - name: Set image tag
# id: set_tag
# run: echo "::set-output name=tag::$(if [ $GITHUB_REF == 'refs/heads/master' ]; then echo 'prod'; else echo 'staging'; fi)"
# - name: Login to Docker Hub
# uses: docker/login-action@v1
# with:
# username: ${{ secrets.DOCKER_USERNAME }}
# password: ${{ secrets.DOCKER_PASSWORD }}
# - name: Build and push Docker image
# uses: docker/build-push-action@v2
# with:
# context: .
# push: true
# tags: |
# docker.io/${{ secrets.DOCKER_USERNAME }}/${{ variables.REPO_NAME }}:${{ steps.get_version.outputs.version }}_${{ steps.set_tag.outputs.tag }}