aio.api.github
: Dev 0.2.8
#7584
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: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
release: | |
types: | |
released | |
permissions: | |
contents: read | |
jobs: | |
test: | |
runs-on: envoy-x64-small | |
if: github.repository_owner == 'envoyproxy' | |
steps: | |
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 | |
- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 | |
with: | |
python-version: "3.9" | |
- name: Cache pants | |
uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1 | |
with: | |
key: ${{ runner.os }}-${{ hashFiles('pants*toml') }} | |
path: ~/.cache/pants/setup | |
- name: Run pants test | |
run: "./pants --colors test ::" | |
- name: Archive code coverage results | |
uses: actions/upload-artifact@84480863f228bb9747b473957fcc9e309aa96097 # v4.4.2 | |
with: | |
name: coverage | |
path: dist/coverage/python/htmlcov/ | |
lint: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 | |
- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 | |
with: | |
python-version: "3.9" | |
- name: Cache pants | |
uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1 | |
with: | |
key: ${{ runner.os }}-${{ hashFiles('pants*toml') }} | |
path: ~/.cache/pants/setup | |
- name: Run pants lint | |
run: "./pants --colors lint ::" | |
lint-envoy: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 | |
- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 | |
with: | |
python-version: "3.11" | |
- run: pip install envoy.code.check>=0.5.11 | |
- run: | | |
envoy.code.check . -c glint shellcheck yamllint -x ".*/dist/.*" | |
typecheck: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 | |
- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 | |
with: | |
python-version: "3.9" | |
- name: Cache pants | |
uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1 | |
with: | |
key: ${{ runner.os }}-${{ hashFiles('pants*toml') }} | |
path: ~/.cache/pants/setup | |
- name: Run pants (type) check | |
run: "./pants --colors check ::" | |
docs: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 | |
- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 | |
with: | |
python-version: "3.9" | |
- name: Cache pants | |
uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1 | |
with: | |
key: ${{ runner.os }}-${{ hashFiles('pants*toml') }} | |
path: ~/.cache/pants/setup | |
- name: Run pants README | |
run: "./pants --colors readme --check=README.md ::" | |
package: | |
runs-on: ubuntu-22.04 | |
needs: | |
- test | |
- lint | |
- typecheck | |
- docs | |
steps: | |
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 | |
- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 | |
with: | |
python-version: "3.9" | |
- name: Cache pants | |
uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1 | |
with: | |
key: ${{ runner.os }}-${{ hashFiles('pants*toml') }} | |
path: ~/.cache/pants/setup | |
- name: Run pants package | |
run: "./pants --colors package ::" | |
- name: Archive created packages | |
uses: actions/upload-artifact@84480863f228bb9747b473957fcc9e309aa96097 # v4.4.2 | |
with: | |
name: packages | |
path: dist | |
publish: | |
runs-on: ubuntu-22.04 | |
needs: | |
- package | |
steps: | |
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 | |
- name: Download all workflow run artifacts | |
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | |
- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 | |
with: | |
python-version: "3.9" | |
- name: Find packages to publish | |
run: | | |
echo "PUBLISH_PACKAGES=true" >> $GITHUB_ENV | |
mkdir dist-out | |
find packages/ -maxdepth 1 -type f ! -path "*dev*" | xargs -I{} cp {} dist-out/ | |
[ "$(ls -A dist-out)" ] || echo "PUBLISH_PACKAGES=false" >> $GITHUB_ENV | |
- name: Publish to PyPi | |
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags') && env.PUBLISH_PACKAGES == 'true' | |
uses: pypa/gh-action-pypi-publish@f7600683efdcb7656dec5b29656edb7bc586e597 # release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_TOKEN }} | |
packages_dir: dist-out/ |