Skip to content

Upgrade to Pants 2.17.0 #18

Upgrade to Pants 2.17.0

Upgrade to Pants 2.17.0 #18

Workflow file for this run

# Copyright 2020 Pants project contributors.
# Licensed under the Apache License, Version 2.0 (see LICENSE).
# See https://pants.readme.io/docs/using-pants-in-ci for tips on how to set up your CI with Pants.
name: Pants
on: [push, pull_request]
jobs:
org-check:
name: Check GitHub Organization
if: ${{ github.repository_owner == 'pantsbuild' }}
runs-on: ubuntu-20.04
steps:
- name: Noop
run: "true"
build:
name: Perform CI Checks
needs: org-check
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [3.9]
node-version: [19.x]
steps:
- uses: actions/checkout@v3
- uses: pantsbuild/actions/init-pants@v2
# This action bootstraps pants and manages 2-3 GHA caches.
# See: github.com/pantsbuild/actions/tree/main/init-pants/
with:
pants-python-version: ${{ matrix.python-version }}
# cache0 makes it easy to bust the cache if needed
# just increase the integer to start with a fresh cache
gha-cache-key: cache0-py${{ matrix.python-version }}
# The Python backend uses named_caches for Pip/PEX state,
# so it is appropriate to invalidate on lockfile changes.
named-caches-hash: ${{ hashFiles('python-default.lock') }}
# 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://pants.readme.io/docs/using-pants-in-ci for tips on how to periodically clean it up.
# Alternatively you change gha-cache-key to ignore old caches.
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Check BUILD files
run: |
pants tailor --check update-build-files --check ::
- name: Lint and typecheck
run: |
pants lint check ::
- name: Test
run: |
pants test ::
- name: Verify Demos
run: |
# We also smoke test that our release process will work by running `package`.
## TODO: debug why `node` cannot be found.
# ./pants package ::
# ./pants run antlr/antlr_demo.py
# ./pants run javascript:run-js-app
# ./pants export-codegen openapi:webapp-js-bindings
- name: Upload pants log
uses: actions/upload-artifact@v3
with:
name: pants-log
path: .pants.d/pants.log
if: always() # We want the log even on failures.