Skip to content

Update Pants to 2.21.0 release #95

Update Pants to 2.21.0 release

Update Pants to 2.21.0 release #95

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 linting and formatting
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
env:
PANTS_CONFIG_FILES: pants.ci.toml
strategy:
matrix:
python-version: [3.9]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: pantsbuild/actions/init-pants@v8
with:
# cache0 makes it easy to bust the cache if needed
gha-cache-key: cache4-py${{ matrix.python_version }}
named-caches-hash: ${{ hashFiles('build-support/lockfiles/*.lock') }}
# - shell: bash
# # https://www.pantsbuild.org/2.20/docs/using-pants/using-pants-in-ci#directories-to-cache
# run: |
# function nuke_if_too_big() {
# path=$1
# limit_mb=$2
# size_mb=$(du -m -d0 "${path}" | cut -f 1)
# if (( size_mb > limit_mb )); then
# echo "${path} is too large (${size_mb}mb), nuking it."
# nuke_prefix="$(dirname "${path}")/$(basename "${path}").nuke"
# nuke_path=$(mktemp -d "${nuke_prefix}.XXXXXX")
# mv "${path}" "${nuke_path}/"
# rm -rf "${nuke_prefix}.*"
# fi
# }
# nuke_if_too_big ${{ inputs.named-caches-location }} 1
- name: Bootstrap Pants
run: |
pants --version
# - name: Check BUILD files
# run: |
# pants update-build-files --check
# - name: Lint and (TODO) typecheck
# run: |
# pants lint ::
# - name: Package/Run smoke test
# run: |
# pants package examples/python::
# pants run examples/python/helloworld:helloworld-pex
- name: Upload pants log
uses: actions/upload-artifact@v2
with:
name: pants-log
path: .pants.d/pants.log
if: always() # We want the log even on failures.