task: fix package name for pypi #160
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
| name: Pants | |
| on: | |
| push: | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pantsbuild/actions/init-pants@v8 | |
| with: | |
| # v0 makes it easy to bust the cache if needed | |
| # just increase the integer to start with a fresh cache | |
| gha-cache-key: v1 | |
| named-caches-hash: ${{ hashFiles('cicd/tools.lock') }} | |
| - name: Setup Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.10" | |
| - name: Setup Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.11" | |
| - name: Setup Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.13" | |
| - name: Bootstrap Pants | |
| run: | | |
| pants --version | |
| - name: Check BUILD files | |
| run: "pants tailor --check update-build-files --check ::" | |
| - name: Lint and typecheck | |
| run: | | |
| pants lint check :: | |
| if: success() || failure() | |
| - name: Test | |
| run: | | |
| pants --tag="-integration" test :: | |
| if: success() || failure() | |
| - name: Upload test coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: dist/coverage/python/coverage.xml | |
| fail_ci_if_error: true | |
| verbose: true | |
| if: always() | |
| - name: Integration Test | |
| run: | | |
| az login --service-principal --tenant ${{ secrets.AZCLI_TENANT_ID }} -u ${{ secrets.AZCLI_USERNAME }} -p ${{ secrets.AZCLI_PASSWORD }} | |
| pants --tag="integration" test :: | |
| if: success() || failure() | |
| - name: Upload test coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: dist/coverage/python/coverage.xml | |
| fail_ci_if_error: true | |
| verbose: true | |
| if: always() | |
| - name: Package | |
| run: | | |
| pants package :: | |
| - name: Validate packages | |
| run: | | |
| set -xe +f | |
| ls dist | |
| files=(dist/alpacloud_ansible_builder-*.tar.gz) | |
| echo "installing ${files[0]}" | |
| pip3 install "${files[0]}" | |
| alpacloud-ansible-builder --help | |
| - name: Upload pants log | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: pants-log-3.13 | |
| path: .pants.d/pants.log | |
| if: always() # We want the log even on failures. |