-
-
Notifications
You must be signed in to change notification settings - Fork 18
78 lines (72 loc) · 2.21 KB
/
pythonpackage.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
name: Python package
on: [push, pull_request]
jobs:
build:
name: Build Job
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.7, 3.8]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install python package locally
run: |
python3 -m pip install --upgrade pip
pip3 install --editable src
- name: Lint with flake8
run: |
pip3 install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
env:
ARCH: "linux/amd64"
TAG_SUFFIX: "amd64"
run: |
pip3 install pytest
pwd
ls -al
echo GITHUB_WORKSPACE=${GITHUB_WORKSPACE}
echo "ARCH=${ARCH}"
${GITHUB_WORKSPACE}/install_requirements.sh
${GITHUB_WORKSPACE}/tests/run-tests.sh
release:
name: Release Job
needs: [build]
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Node.js 12
uses: actions/setup-node@v2
with:
node-version: lts/*
- name: Install Python 3
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Run Semantic Release
id: semrel
uses: cycjimmy/semantic-release-action@v2
with:
extra_plugins: |
@semantic-release/changelog
@semantic-release/git
@semantic-release/exec
branches: |
[
'master', 'main'
]
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Semantic release completed
run: echo Semantic release flow completed