forked from 030/gomod-go-version-updater-action
-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (54 loc) · 1.76 KB
/
python.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
name: python
"on": push
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: testing
run: |
check_label_exists() {
local label_name="$1"
LABEL_EXISTS=$(
gh label list --json name |
jq -r '
.[] |
select(.name == "'"$label_name"'") |
.name
'
)
if [ -z "$LABEL_EXISTS" ]; then
echo "label: '${label_name}' does NOT exist"
return 1
fi
}
dependenciesLabel=dependencies
if ! check_label_exists ${dependenciesLabel}; then
gh label create ${dependenciesLabel} \
--color "#0366d6" \
--description "Pull requests that update a dependency file"
fi
goLabel=go
if ! check_label_exists ${goLabel}; then
gh label create ${goLabel} \
--color "#16e2e2" \
--description "Pull requests that update Go code"
fi
goModUpdaterLabel=gomod-go-version-updater
if ! check_label_exists ${goModUpdaterLabel}; then
gh label create ${goModUpdaterLabel} \
--color "#F50BAB" \
--description "Pull requests that update Go version in the go.mod file"
fi
env:
GH_TOKEN: ${{ github.token }}
- uses: actions/[email protected]
with:
python-version: 3.9.18
cache: "pip"
- name: Install PIP packages defined in requirements.txt
run: |
pip install -r requirements.txt
- name: Run tests
run: |
pytest --cov=main test.py --verbose --capture=no --cov-report term-missing