|
5 | 5 |
|
6 | 6 | name: Pants |
7 | 7 |
|
8 | | -on: [push, pull_request] |
| 8 | +on: [push, workflow_dispatch] |
9 | 9 |
|
10 | 10 | jobs: |
11 | | - org-check: |
12 | | - name: Check GitHub Organization |
13 | | - if: ${{ github.repository_owner == 'pantsbuild' }} |
14 | | - runs-on: ubuntu-24.04 |
15 | | - steps: |
16 | | - - name: Noop |
17 | | - run: "true" |
18 | 11 | build: |
19 | 12 | name: Perform CI Checks |
20 | | - needs: org-check |
21 | | - runs-on: ubuntu-24.04 |
| 13 | + runs-on: |
| 14 | + # Replace with your profile label https://namespace.so/docs/features/faster-github-actions#using-runner-profiles |
| 15 | + - namespace-profile-default |
22 | 16 | strategy: |
23 | 17 | matrix: |
24 | 18 | python-version: [3.9] |
25 | 19 | steps: |
26 | 20 | - uses: actions/checkout@v4 |
| 21 | + - name: Set up remote cache |
| 22 | + run: | |
| 23 | + nsc pants cache setup --pants-toml=/tmp/pants.toml |
27 | 24 | - uses: actions/setup-python@v5 |
28 | 25 | with: |
29 | 26 | python-version: ${{ matrix.python-version }} |
30 | 27 | - uses: pantsbuild/actions/init-pants@v8 |
31 | 28 | # This action bootstraps pants and manages 2-3 GHA caches. |
32 | 29 | # See: github.com/pantsbuild/actions/tree/main/init-pants/ |
33 | 30 | with: |
34 | | - # v0 makes it easy to bust the cache if needed |
35 | | - # just increase the integer to start with a fresh cache |
36 | 31 | gha-cache-key: v0 |
37 | | - # The Python backend uses named_caches for Pip/PEX state, |
38 | | - # so it is appropriate to invalidate on lockfile changes. |
39 | 32 | named-caches-hash: ${{ hashFiles('python-default.lock') }} |
40 | | - # If you're not using a fine-grained remote caching service (see https://www.pantsbuild.org/docs/remote-caching), |
41 | | - # then you may also want to preserve the local Pants cache (lmdb_store). However this must invalidate for |
42 | | - # changes to any file that can affect the build, so may not be practical in larger repos. |
43 | | - # A remote cache service integrates with Pants's fine-grained invalidation and avoids these problems. |
44 | | - cache-lmdb-store: 'true' # defaults to 'false' |
45 | | - # Note that named_caches and lmdb_store falls back to partial restore keys which |
46 | | - # may give a useful partial result that will save time over completely clean state, |
47 | | - # but will cause the cache entry to grow without bound over time. |
48 | | - # See https://www.pantsbuild.org/stable/docs/using-pants/using-pants-in-ci for tips on how to periodically clean it up. |
49 | | - # Alternatively you change gha-cache-key to ignore old caches. |
| 33 | + pants-ci-config: | |
| 34 | + pants.toml |
| 35 | + pants.ci.toml |
| 36 | + /tmp/pants.toml |
| 37 | +
|
50 | 38 | - name: Check BUILD files |
51 | 39 | run: | |
52 | 40 | pants tailor --check update-build-files --check :: |
|
0 commit comments