-
Notifications
You must be signed in to change notification settings - Fork 118
55 lines (52 loc) · 1.34 KB
/
build.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: Build
on: [push, pull_request]
permissions:
actions: write
checks: write
contents: read
deployments: read
issues: write
discussions: write
packages: read
pages: write
pull-requests: write
security-events: write
statuses: write
env:
PANTS_CONFIG_FILES: "pants.ci.toml"
jobs:
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
os: ["ubuntu-latest"]
steps:
- name: Clone repo
uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Initialize pants
uses: pantsbuild/actions/init-pants@main
with:
gha-cache-key: cache0-py${{ matrix.python }}
named-caches-hash: ${{ hashFiles('requirements.txt') }}
- name: Get branch to compare
run: |
git remote set-branches origin 4.x
git fetch --depth 1 origin 4.x
- name: Check BUILD files
run: |
pants --changed-since=origin/4.x \
tailor --check \
update-build-files --check \
lint
- name: Run tests
run: |
pants --changed-since=origin/4.x \
--changed-dependents=transitive \
test --use-coverage