-
Notifications
You must be signed in to change notification settings - Fork 17
Replaced 3rd party script with first-party script exposing GH vars #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+73
−58
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ jobs: | |
steps: | ||
- name: Noop | ||
run: "true" | ||
|
||
build: | ||
name: Perform CI Checks | ||
needs: org-check | ||
|
@@ -23,65 +24,79 @@ jobs: | |
matrix: | ||
python-version: [3.8] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- uses: crazy-max/ghaction-setup-docker@v3 | ||
with: | ||
daemon-config: | | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- uses: crazy-max/ghaction-setup-docker@v3 | ||
with: | ||
daemon-config: | | ||
{ | ||
"features": { | ||
"containerd-snapshotter": true | ||
} | ||
} | ||
- uses: docker/setup-buildx-action@v3 | ||
with: | ||
install: true | ||
driver: docker | ||
# Required for multi-platform builds | ||
- name: Setup QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
with: | ||
platforms: linux/amd64,linux/arm64 | ||
# Exposes Github env vars needed for docker caching - see https://github.com/orgs/community/discussions/42856 | ||
- name: Expose GitHub Runtime | ||
uses: crazy-max/ghaction-github-runtime@v3 | ||
- uses: pantsbuild/actions/init-pants@v5-scie-pants | ||
# This action bootstraps pants and manages 2-3 GHA caches. | ||
# See: github.com/pantsbuild/actions/tree/main/init-pants/ | ||
with: | ||
# v0 makes it easy to bust the cache if needed | ||
# just increase the integer to start with a fresh cache | ||
gha-cache-key: v0 | ||
# This repo has no 3rd-party requirements and no lockfiles, so we don't invalidate | ||
# the named caches on anything extra. See other example repos for better examples of | ||
# how to set up this cache. | ||
named-caches-hash: "" | ||
# If you're not using a fine-grained remote caching service (see https://www.pantsbuild.org/docs/remote-caching), | ||
# then you may also want to preserve the local Pants cache (lmdb_store). However this must invalidate for | ||
# changes to any file that can affect the build, so may not be practical in larger repos. | ||
# A remote cache service integrates with Pants's fine-grained invalidation and avoids these problems. | ||
cache-lmdb-store: 'true' # defaults to 'false' | ||
# Note that named_caches and lmdb_store falls back to partial restore keys which | ||
# may give a useful partial result that will save time over completely clean state, | ||
# but will cause the cache entry to grow without bound over time. | ||
# See https://www.pantsbuild.org/2.21/docs/using-pants/using-pants-in-ci for tips on how to periodically clean it up. | ||
# Alternatively you change gha-cache-key to ignore old caches. | ||
- name: Bootstrap Pants | ||
run: pants --version | ||
- name: Check Pants config files | ||
run: pants tailor --check update-build-files --check '::' | ||
- name: Lint, compile, and test | ||
run: pants lint check test '::' | ||
- name: Package / Run | ||
env: | ||
DYNAMIC_TAG: workflow | ||
run: | | ||
pants --docker-build-verbose package :: | ||
- name: Upload Pants log | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: pants-log | ||
path: .pants.d/pants.log | ||
if: always() # We want the log even on failures. | ||
} | ||
|
||
- uses: docker/setup-buildx-action@v3 | ||
with: | ||
install: true | ||
driver: docker | ||
|
||
# Required for multi-platform builds | ||
- name: Setup QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
with: | ||
platforms: linux/amd64,linux/arm64 | ||
|
||
- name: Set up environment variables for Pants (Docker) to use GHA Cache | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Change 1: Replaced crazy-max with GH script |
||
uses: actions/github-script@v7 | ||
with: | ||
script: | | ||
core.exportVariable("ACTIONS_CACHE_URL", process.env.ACTIONS_CACHE_URL || ""); | ||
core.exportVariable("ACTIONS_RUNTIME_TOKEN", process.env.ACTIONS_RUNTIME_TOKEN || ""); | ||
|
||
- uses: pantsbuild/actions/init-pants@v9 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Change 2: Bumped version |
||
# This action bootstraps pants and manages 2-3 GHA caches. | ||
# See: github.com/pantsbuild/actions/tree/main/init-pants/ | ||
with: | ||
# v0 makes it easy to bust the cache if needed | ||
# just increase the integer to start with a fresh cache | ||
gha-cache-key: v0 | ||
# This repo has no 3rd-party requirements and no lockfiles, so we don't invalidate | ||
# the named caches on anything extra. See other example repos for better examples of | ||
# how to set up this cache. | ||
named-caches-hash: "" | ||
# If you're not using a fine-grained remote caching service (see https://www.pantsbuild.org/docs/remote-caching), | ||
# then you may also want to preserve the local Pants cache (lmdb_store). However this must invalidate for | ||
# changes to any file that can affect the build, so may not be practical in larger repos. | ||
# A remote cache service integrates with Pants's fine-grained invalidation and avoids these problems. | ||
cache-lmdb-store: "true" # defaults to 'false' | ||
# Note that named_caches and lmdb_store falls back to partial restore keys which | ||
# may give a useful partial result that will save time over completely clean state, | ||
# but will cause the cache entry to grow without bound over time. | ||
# See https://www.pantsbuild.org/2.21/docs/using-pants/using-pants-in-ci for tips on how to periodically clean it up. | ||
# Alternatively you change gha-cache-key to ignore old caches. | ||
|
||
- name: Bootstrap Pants | ||
run: pants --version | ||
|
||
- name: Check Pants config files | ||
run: pants tailor --check update-build-files --check '::' | ||
|
||
- name: Lint, compile, and test | ||
run: pants lint check test '::' | ||
|
||
- name: Package / Run | ||
env: | ||
DYNAMIC_TAG: workflow | ||
run: | | ||
pants --docker-build-verbose package :: | ||
|
||
- name: Upload Pants log | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: pants-log | ||
path: .pants.d/pants.log | ||
if: always() # We want the log even on failures. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure the diff is "hiding whitespace", otherwise this will be a pain