-
Notifications
You must be signed in to change notification settings - Fork 17
110 lines (85 loc) · 2.72 KB
/
verify.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: verify
on:
pull_request:
# paths:
# - '**.py'
env:
PKG_NAME: didcomm
jobs:
release-ready:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'stable'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
id: setup
with:
python-version: '3.x'
- name: Install dependencies
run: pip install tomli
- name: Get current version
id: current_version
run: python ./.github/scripts/current_version.py
- name: Check version format
run: |
# verify the version has "MAJOR.MINOR.PATCH" parts only
echo "${{ steps.current_version.outputs.current_version }}" | grep -e '^[0-9]\+\.[0-9]\+\.[0-9]\+$'
shell: bash
# TODO improve (DRY): copy-paste from release.yml
- name: Get release info
id: release_info
run: |
release_info="$(curl -s https://api.github.com/repos/${{ github.repository }}/releases \
| jq '.[] | select(.name == "v${{ steps.current_version.outputs.current_version }}")')"
echo "::set-output name=release_info::$release_info"
echo "$release_info"
shell: bash
- name: fail unless release not found
# TODO check if greater than latest tag / release (?)
if: steps.release_info.outputs.release_info
run: exit 1
static-black:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.7
id: setup
uses: actions/setup-python@v4
with:
python-version: '3.7'
- name: Install black
run: pipx install black
- name: Black Format Check
run: black --check .
static-flake8:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.7
id: setup
uses: actions/setup-python@v4
with:
python-version: '3.7'
- name: Install flake8
run: pipx install flake8
- name: Lint with flake8
run: flake8 .
unit:
strategy:
matrix:
python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11' ]
os: [ ubuntu-latest, windows-latest, macos-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
id: setup
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install poetry
run: pipx install poetry --python ${{ steps.setup.outputs.python-path }}
- name: Install dependencies
run: poetry install
- name: Test with pytest
run: poetry run pytest