Run CI tests against in-repo pex tool #606
Workflow file for this run
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: | |
matrix: | |
python-version: | |
- '3.8' | |
- '3.9' | |
- '3.10' | |
- '3.11' | |
- '3.12' | |
pex-tool: | |
- default | |
- in-repo | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Set profile | |
run: export PLZ_CONFIG_PROFILE=ci && echo $PATH | |
- 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=-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 --profile ci --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 | |
release: | |
needs: [test] | |
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 |