-
Notifications
You must be signed in to change notification settings - Fork 30
46 lines (46 loc) · 1.51 KB
/
ci.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
name: CI
on: [push, pull_request]
concurrency:
group: CI-${{ github.ref }}
cancel-in-progress: true
env:
PYTHON_VERSION: 3.9
jobs:
org-check:
name: Check GitHub Organization
if: ${{ github.repository_owner == 'pantsbuild' }}
runs-on: ubuntu-20.04
steps:
- name: Noop
run: "true"
tests:
# It's only necessary to typecheck and lint on one platform, but those goals are so fast
# in this repo that a separate job for them would be almost entirely wasteful overhead,
# and logic to only run them in one of these matrixed jobs would be more complicated
# than it's worth.
name: (${{ matrix.os }}) Test, Typecheck and Lint
needs: org-check
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, macos-11]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Ensure default install path is on PATH
# Do this here so that we can change the path before updating the init-pants action.
run: echo "${HOME}/.local/bin" >> $GITHUB_PATH
- name: Setup Pants
uses: pantsbuild/actions/init-pants@v4-scie-pants
with:
gha-cache-key: v2
named-caches-hash: ${{ hashFiles('tests/requirements.lock') }}
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Expose Pythons
uses: pantsbuild/actions/expose-pythons@v2
- name: Run Tests
run: |
pants test check lint ::