copy whl from outer context; stop on fail #54
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: main | |
on: | |
push: { branches: [main] } | |
pull_request: { branches: [main] } | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: { python-version: "3.11", cache: pip } | |
- run: pip install .[test] | |
- {name: "lint: black", run: black --check --diff . } | |
- {name: "lint: isort", run: isort --check --diff . } | |
# Temporarily disabled due to bugs in typing in click library | |
# https://github.com/pallets/click/pull/2559 | |
# https://github.com/python/mypy/issues/13250 | |
# https://github.com/python/mypy/issues/13449 | |
#- {name: "lint: mypy", run: make mypy } | |
push_to_dockerhub: | |
runs-on: ubuntu-latest | |
env: | |
CLICKHOUSE_VERSIONS: "21.8.15.7, 22.3.20.29, 22.8.19.10, 23.3.4.17, 23.4.4.16, 23.5.3.24, latest" | |
if: ${{ github.event_name == 'push' }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: login to dockerhub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: build and push base images | |
uses: docker/bake-action@v3 | |
with: | |
files: tests/bake.hcl | |
push: true | |
build: | |
needs: lint | |
strategy: | |
matrix: | |
target: | |
- {python: "3.6.15", ubuntu: "20.04"} | |
- {python: "3.10.12", ubuntu: "latest"} | |
# a copy-paste of the above as github CI can't use env context in matrices | |
clickhouse: | |
- "21.8.15.7" | |
- "22.3.20.29" | |
- "22.8.19.10" | |
- "23.3.4.17" | |
- "23.4.4.16" | |
- "23.5.3.24" | |
- "latest" | |
runs-on: ubuntu-${{ matrix.target.ubuntu }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: set up python ${{ matrix.target.python }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.target.python }} | |
cache: pip | |
- {name: install dependencies, run: "pip install .[test]" } | |
- {name: build project, run: flit build --no-use-vcs } | |
- name: upload wheel | |
uses: actions/upload-artifact@v3 | |
if: ${{ matrix.clickhouse == 'latest' }} | |
with: | |
name: chtools-py${{ matrix.target.python }}.whl | |
path: dist/*.whl | |
if-no-files-found: error | |
- name: upload sdist | |
uses: actions/upload-artifact@v3 | |
if: ${{ matrix.clickhouse == 'latest' }} | |
with: | |
name: chtools-py${{ matrix.target.python }}.tar.gz | |
path: dist/*.tar.gz | |
if-no-files-found: error | |
- {name: run unit tests, run: pytest} | |
- name: prepare integration tests | |
run: | | |
cd tests | |
CLICKHOUSE_VERSION=${{ matrix.clickhouse }} python3 -m env_control create | |
cd .. | |
- name: run integration tests | |
run: | | |
cd tests | |
behave --show-timings --junit -D skip_setup | |
cd .. | |
- name: publish test report | |
uses: mikepenz/action-junit-report@v3 | |
if: always() | |
with: | |
report_paths: 'tests/reports/*.xml' |