Tag v1.12.1 (#232) #738
This file contains 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
name: Python rules | |
on: [push, pull_request] | |
jobs: | |
test: | |
name: Test (Python ${{ matrix.python-version }}, ${{ matrix.pex-tool }} pex tool) | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: | |
- '3.9' | |
- '3.10' | |
- '3.11' | |
- '3.12' | |
- '3.13' | |
pex-tool: | |
- default | |
- in-repo | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Use this Python in Please build environments | |
run: | | |
echo "CI_PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV | |
echo "PLZ_ARGS=-o plugin.python.defaultinterpreter:$(which python3) -o build.passenv:CI_PYTHON_VERSION" >> $GITHUB_ENV | |
- name: Build and use in-repo pex tool | |
if: matrix.pex-tool == 'in-repo' | |
run: | | |
./pleasew build //tools/please_pex | |
cp $(./pleasew query outputs //tools/please_pex) $HOME/please_pex | |
echo "PLZ_ARGS="$(grep ^PLZ_ARGS= $GITHUB_ENV | cut -d= -f2-)" -o plugin.python.pextool:$HOME/please_pex" >> $GITHUB_ENV | |
- name: Run tests | |
run: ./pleasew test --log_file plz-out/log/test.log -e e2e | |
- name: Run e2e test | |
run: ./pleasew test --log_file plz-out/log/e2e.log -i e2e | |
- name: Archive logs | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: logs-${{ matrix.python-version }}-please_pex-${{ matrix.pex-tool }} | |
path: plz-out/log | |
test_in_repo_python: | |
name: Test (Python 3.12 in repo) | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Run tests | |
run: ./pleasew test --profile in_repo_python | |
- name: Archive logs | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: logs-in-repo-python | |
path: plz-out/log | |
release: | |
needs: [test, test_in_repo_python] | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/v1' | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Build | |
run: ./pleasew build //package:release_files | |
- name: Release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
uses: thought-machine/[email protected] | |
- name: Release tools | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
uses: thought-machine/[email protected] | |
with: | |
release-files: plz-out/package | |
version-file: tools/VERSION | |
change-log-file: tools/ChangeLog | |
release-prefix: tools |