Repository navigation
156 lines (152 loc) · 4.65 KB
/
Copy pathgeneric.yml
File metadata and controls
156 lines (152 loc) · 4.65 KB
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
name: Reusable package workflow
on:
workflow_call:
inputs:
packages:
required: true
type: string
secrets:
CC_TEST_REPORTER_ID:
required: true
PYPI_TOKEN:
required: true
GH_TOKEN:
required: true
GIT_AUTHOR_EMAIL:
required: true
GIT_AUTHOR_NAME:
required: true
GIT_COMMITTER_EMAIL:
required: true
GIT_COMMITTER_NAME:
required: true
SLACK_WEBHOOK:
required: true
jobs:
changes:
name: changes
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- id: changes
uses: ./.github/actions/changes
lint:
name: Linting
needs: [ changes ]
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10']
current_package: ${{ fromJson(inputs.packages) }}
steps:
- uses: actions/checkout@v3
- id: lint
if: needs.changes.steps.changes.outputs.${{ matrix.current_package }} == 'true'
uses: ./.github/actions/linting
with:
python-version: ${{ matrix.python-version }}
current_package: ${{ matrix.current_package }}
isort:
name: Isorting
needs: [ changes ]
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10']
current_package: ${{ fromJson(inputs.packages) }}
steps:
- uses: actions/checkout@v3
- id: isort
if: needs.changes.outputs.${{ matrix.current_package }} == 'true'
uses: ./.github/actions/isort
with:
python-version: ${{ matrix.python-version }}
current_package: ${{ matrix.current_package }}
black:
name: Black
needs: [ changes ]
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10']
current_package: ${{ fromJson(inputs.packages) }}
steps:
- uses: actions/checkout@v3
- id: isort
if: needs.changes.outputs.${{ matrix.current_package }} == 'true'
uses: ./.github/actions/black
with:
python-version: ${{ matrix.python-version }}
current_package: ${{ matrix.current_package }}
test:
name: Test
needs: [isort, lint, black]
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
current_package: ${{ fromJson(inputs.packages) }}
steps:
- uses: actions/checkout@v3
- id: tests
if: steps.changes.outputs.${{ matrix.current_package }} == 'true'
uses: ./.github/actions/tests
with:
python-version: ${{ matrix.python-version }}
current_package: ${{ matrix.current_package }}
coverage:
name: Coverage
needs: [test]
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10']
steps:
- uses: actions/checkout@v3
- id: coverage
uses: ./.github/actions/coverage
with:
python-version: ${{ matrix.python-version }}
current_package: ./src/datasource_toolkit
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
semantic_release:
name: Semantic release
needs: [coverage]
runs-on: ubuntu-latest
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/beta')
outputs:
new_release_published: ${{ steps.release.outputs.new_release_published }}
new_release_version: ${{ steps.release.outputs.new_release_version }}
strategy:
matrix:
python-version: ['3.10']
steps:
- uses: actions/checkout@v3
- id: release
uses: ./.github/actions/release
with:
packages: ${{ inputs.packages }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }}
GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }}
GIT_COMMITTER_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }}
GIT_COMMITTER_NAME: ${{ secrets.GIT_COMMITTER_NAME }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
pypi:
name: Push to pypi
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/beta') && needs.semantic_release.outputs.new_release_published == 'true'
needs: [semantic_release]
runs-on: ubuntu-latest
strategy:
max-parallel: 6
matrix:
python-version: ['3.10']
current_package: ${{ fromJson(inputs.packages) }}
steps:
- uses: actions/checkout@v3
- id: pypi
uses: ./.github/actions/pypi
with:
current_package: ${{ matrix.current_package }}
python-version: ${{ matrix.python-version }}
pypi_token: ${{ secrets.PYPI_TOKEN }}