Fix warning about Airflow version in venv not matching the Astro Runt… #76
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: Provider | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- buildkit/** | |
- '.github/workflows/buildkit.yml' | |
tags: | |
- 'provider/**' | |
pull_request: | |
paths-ignore: | |
- buildkit/** | |
- '.github/workflows/buildkit.yml' | |
jobs: | |
test: | |
strategy: | |
matrix: | |
platform: | |
- ubuntu-latest | |
python-version: | |
- '3.7' | |
# - '3.8' | |
# - '3.9' | |
# - '3.10' | |
- '3.11' | |
include: | |
# And for one matrix job, upload the artifacts for every PR/build | |
- python-verion: '3.11' | |
platform: ubuntu-latest | |
wheels-to-artifacts: true | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- uses: actions/checkout@v3 | |
- id: setup | |
name: Setup toolchains | |
uses: ./.github/actions/setup-env | |
with: | |
python-version: ${{ matrix.python-version }} | |
python-extras: | | |
build | |
wheel | |
- run: "pip install '.[tests]' -v" | |
- name: python tests | |
run: python -m pytest | |
- name: build wheel | |
uses: hynek/build-and-inspect-python-package@v1 | |
# Don't build wheel here if we'd do a full build anyway | |
if: matrix.wheels-to-artifacts && (github.ref_type != 'tag' && github.ref != 'refs/heads/main' && !contains(github.event.pull_request.labels.*.name, 'Full Build')) | |
lint: | |
uses: ./.github/workflows/lint.yml | |
# https://github.com/marketplace/actions/alls-green#why used for branch protection checks | |
check: | |
if: always() | |
needs: [test, lint] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Decide whether the needed jobs succeeded or failed | |
uses: re-actors/alls-green@release/v1 | |
with: | |
jobs: ${{ toJSON(needs) }} | |
build: | |
strategy: | |
matrix: | |
os: [ubuntu] | |
target: [x86_64] | |
name: build on ${{ matrix.os }} (${{ matrix.target }}) | |
# only run on push to main and on release, or with tag | |
if: "success() && (github.ref_type == 'tag' || github.ref == 'refs/heads/main' || contains(github.event.pull_request.labels.*.name, 'Full Build'))" | |
runs-on: ${{ matrix.os }}-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: hynek/build-and-inspect-python-package@v1 | |
release: | |
needs: [build, check] | |
if: "success() && startsWith(github.ref, 'refs/tags/')" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: get dist artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: Packages | |
path: dist | |
- id: check-version | |
name: check package version | |
run: python .github/check-version.py | |
- run: pip install twine | |
if: ${{ ! steps.check-version.outputs.is_prerelease }} | |
- name: upload to pypi | |
run: twine upload dist/* | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.pypi_token }} | |
if: ${{ ! steps.check-version.outputs.is_prerelease }} | |
- name: upload to github release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
dist/* | |
generate_release_notes: true | |
prerelease: ${{ steps.check-version.outputs.is_prerelease }} |