-
Notifications
You must be signed in to change notification settings - Fork 1
64 lines (60 loc) · 1.71 KB
/
pr.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
name: PR build
on:
push:
branches: [ 'dev' ]
pull_request:
branches: [ 'dev' ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up python
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pipenv
python -m pipenv install --dev
- name: Code Style
run: |
python -m pipenv run flake8 mdbackup
python -m pipenv run flake8 tests
- name: Test
run: |
python -m pipenv run coverage run --source=mdbackup --branch -m xmlrunner discover -s tests -p '*tests*.py' -o tests/.report
python -m pipenv run coverage html -d tests/.coverage-report/
- name: Archive test results
uses: actions/upload-artifact@v3
with:
name: test-results
path: tests/.report/**/*.xml
retention-days: 30
- name: Archive code coverage results
uses: actions/upload-artifact@v3
with:
name: code-coverage-report
path: tests/.coverage-report/**/*.html
retention-days: 30
docker:
strategy:
matrix:
flavour:
- alpine
- slim
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
file: ./docker/Dockerfile-${{ matrix.flavour }}
push: false
platforms: linux/amd64