-
Notifications
You must be signed in to change notification settings - Fork 6
82 lines (80 loc) · 2.41 KB
/
checks.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
name: proTES checks
on:
push:
branches: [dev]
pull_request:
branches: [dev]
jobs:
lint:
name: Run linting
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install requirements
run: |
pip install .
pip install -r requirements_dev.txt
- name: Lint with Flake8
run: flake8 pro_tes/ setup.py
- name: Lint with Pylint
run: pylint pro_tes/ setup.py
test:
name: Run tests
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install requirements
run: |
pip install .
pip install -r requirements_dev.txt
- name: Deploy app
run: docker-compose up -d --build
- name: Wait for app startup
run: sleep 20
- name: Run integration tests
shell: bash
run: pytest tests/test_integration
- name: Tear down app
run: docker-compose down
publish:
name: Build and publish app image
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' }}
needs: [lint, test]
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Generate tag
run: |
echo "TAG=$(date '+%Y%m%d')" >> $GITHUB_ENV
- name: Build and publish image
id: docker
uses: philips-software/[email protected]
with:
dockerfile: .
image-name: "protes"
tags: "latest ${{ env.TAG }}"
push-branches: "${{ github.event.repository.default_branch }}"
env:
REGISTRY_USERNAME: ${{ secrets.DOCKERHUB_LOGIN }}
REGISTRY_TOKEN: "${{ secrets.DOCKERHUB_TOKEN }}"
DOCKER_ORGANIZATION: ${{ secrets.DOCKERHUB_ORG }}
GITHUB_ORGANIZATION: ${{ github.repository_owner }}
- name: Verify that image was pushed
run: |
echo "Push indicator: ${{ steps.docker.outputs.push-indicator }}"
echo "# Set to 'true' if image was pushed, empty string otherwise"
test "${{ steps.docker.outputs.push-indicator }}" == "true"