-
Notifications
You must be signed in to change notification settings - Fork 0
172 lines (166 loc) · 5.69 KB
/
pull-request.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
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
name: 'linting and testing'
on:
pull_request:
types:
- opened
- synchronize
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
which-paths:
runs-on: ubuntu-latest
outputs:
HATCH_VCS_TUNABLE_DIFF: ${{ steps.hatch-vcs-tunable-diff.outputs.HATCH_VCS_TUNABLE_DIFF }}
HATCH_DEPENDENCY_COVERSION_DIFF: ${{ steps.hatch-dependency-coversion-diff.outputs.HATCH_DEPENDENCY_COVERSION_DIFF }}
MANAGEMENT_DIFF: ${{ steps.management-diff.outputs.MANAGEMENT_DIFF }}
steps:
- name: Fetch repo for diffing
uses: actions/checkout@v3
- name: Check if vcs-tunable-analysis changed
uses: technote-space/get-diff-action@v6
with:
PATTERNS: |
hatch-vcs-tunable/**/*
hatch-vcs-tunable/**/.*
FILES: |
.github/workflows/pull-request.yml
- name: Set diff output for hatch-vcs-tunable
id: hatch-vcs-tunable-diff
run: |
echo "HATCH_VCS_TUNABLE_DIFF=\"$(echo ${GIT_DIFF_FILTERED} | sed 's/ *$//')\"" >> $GITHUB_OUTPUT
- name: Check if dependency-coversion-analysis changed
uses: technote-space/get-diff-action@v6
with:
PATTERNS: |
hatch-dependency-coversion/**/*
hatch-dependency-coversion/**/.*
FILES: |
.github/workflows/pull-request.yml
- name: Set diff output for hatch-dependency-coversion
id: hatch-dependency-coversion-diff
run: |
echo "HATCH_DEPENDENCY_COVERSION_DIFF=\"$(echo ${GIT_DIFF_FILTERED} | sed 's/ *$//')\"" >> $GITHUB_OUTPUT
- name: Check if repo management changed
uses: technote-space/get-diff-action@v6
with:
PATTERNS: |
**/*
.*
.*/**/*
!hatch-vcs-tunable/**/*
!hatch-dependency-coversion/**/*
- name: Set diff output for management
id: management-diff
run: |
echo "MANAGEMENT_DIFF=\"$(echo ${GIT_DIFF_FILTERED} | set 's/ *$//')\"" >> $GITHUB_OUTPUT
hatch-vcs-tunable-analysis:
if: ${{ needs.which-paths.outputs.HATCH_VCS_TUNABLE_DIFF != '""' }}
runs-on: ubuntu-latest
needs: [which-paths]
steps:
- name: Install python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Set up python environment
run: |
python -m pip install pipx
pipx install hatch
- name: Fetch repo
uses: actions/checkout@v3
- name: Create default env
run: hatch env create default
working-directory: hatch-vcs-tunable
- name: Check formatting
run: hatch run format --check
working-directory: hatch-vcs-tunable
- name: Lint
run: hatch run lint
working-directory: hatch-vcs-tunable
- name: Check types
run: hatch run check
working-directory: hatch-vcs-tunable
- name: Quick tests
run: hatch run test
working-directory: hatch-vcs-tunable
hatch-vcs-tunable-tests:
if: ${{ needs.which-paths.outputs.HATCH_VCS_TUNABLE_DIFF != '""' }}
needs: [which-paths, hatch-vcs-tunable-analysis]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Install python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Set up python environment
run: |
python -m pip install pipx
pipx install hatch
- name: Fetch repo
uses: actions/checkout@v3
- name: Create test env
run: hatch env create test
working-directory: hatch-vcs-tunable
- name: Run all tests
run: hatch run test:test
working-directory: hatch-vcs-tunable
hatch-dependency-coversion-analysis:
if: ${{ needs.which-paths.outputs.HATCH_DEPENDENCY_COVERSION_DIFF != '""' }}
runs-on: ubuntu-latest
needs: [which-paths]
steps:
- name: Install python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Set up python environment
run: |
python -m pip install pipx
pipx install hatch
- name: Fetch repo
uses: actions/checkout@v3
- name: Create default env
run: hatch env create default
working-directory: hatch-dependency-coversion
- name: Check formatting
run: hatch run format --check
working-directory: hatch-dependency-coversion
- name: Lint
run: hatch run lint
working-directory: hatch-dependency-coversion
- name: Check types
run: hatch run check
working-directory: hatch-dependency-coversion
- name: Quick tests
run: hatch run test
working-directory: hatch-dependency-coversion
hatch-dependency-coversion-tests:
if: ${{ needs.which-paths.outputs.HATCH_DEPENDENCY_COVERSION_DIFF != '""' }}
needs: [which-paths, hatch-dependency-coversion-analysis]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Install python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Set up python environment
run: |
python -m pip install pipx
pipx install hatch
- name: Fetch repo
uses: actions/checkout@v3
- name: Create test env
run: hatch env create test
working-directory: hatch-dependency-coversion
- name: Run all tests
run: hatch run test:test
working-directory: hatch-dependency-coversion