forked from WithSecureOpenSource/flaky-tests-detection
-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (71 loc) · 1.87 KB
/
publish.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
name: publish
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
check:
name: Check commit message
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Check commit message
uses: adityaa30/check-commit@master
with:
max-header-length: 255
test:
name: Run pytest
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: pip install -e .[dev]
- name: Run mypy
run: mypy . --ignore-missing-imports
- name: Run tests
run: pytest --cov=.
build-and-run-docker-image:
name: Docker build
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Build
run: |
docker build . -t flaky-docker
docker run flaky-docker --test-history-csv=test.csv --grouping-option=runs --window-size=2 --window-count=5 --top-n=5 --heatmap
release:
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
name: Publish
needs: build-and-run-docker-image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.6
- name: Publish
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
git config user.email "semantic-release"
git config user.name "semantic-release"
make publish