-
Notifications
You must be signed in to change notification settings - Fork 190
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update workflow files to use hatch.toml
- Loading branch information
1 parent
6df3421
commit 5869413
Showing
7 changed files
with
555 additions
and
250 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,124 +38,52 @@ defaults: | |
jobs: | ||
code-quality: | ||
name: code-quality | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out the repository | ||
uses: actions/checkout@v4 | ||
- uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.9' | ||
|
||
- name: Install python dependencies | ||
run: | | ||
python -m pip install --user --upgrade pip | ||
python -m pip install -r dev-requirements.txt | ||
python -m pip --version | ||
pre-commit --version | ||
dbt --version | ||
- name: Run pre-commit hooks | ||
run: pre-commit run --all-files --show-diff-on-failure | ||
- uses: pre-commit/[email protected] | ||
|
||
unit: | ||
name: unit test / python ${{ matrix.python-version }} | ||
|
||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ['3.9', '3.10', '3.11', '3.12'] | ||
|
||
env: | ||
TOXENV: "unit" | ||
PYTEST_ADDOPTS: "-v --color=yes --csv unit_results.csv" | ||
|
||
steps: | ||
- name: Check out the repository | ||
uses: actions/checkout@v4 | ||
- uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install python dependencies | ||
run: | | ||
python -m pip install --user --upgrade pip | ||
python -m pip install tox | ||
python -m pip --version | ||
tox --version | ||
- name: Run tox | ||
run: tox | ||
|
||
- name: Get current date | ||
if: always() | ||
id: date | ||
run: echo "date=$(date +'%Y-%m-%dT%H_%M_%S')" >> $GITHUB_OUTPUT #no colons allowed for artifacts | ||
|
||
- uses: actions/upload-artifact@v4 | ||
if: always() | ||
with: | ||
name: unit_results_${{ matrix.python-version }}-${{ steps.date.outputs.date }}.csv | ||
path: unit_results.csv | ||
overwrite: true | ||
- uses: pypa/hatch@install | ||
- run: hatch run unit-tests | ||
|
||
build: | ||
name: build packages | ||
|
||
runs-on: ubuntu-latest | ||
|
||
outputs: | ||
is_alpha: ${{ steps.check-is-alpha.outputs.is_alpha }} | ||
|
||
steps: | ||
- name: Check out the repository | ||
uses: actions/checkout@v4 | ||
- uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.9' | ||
|
||
- name: Install python dependencies | ||
run: | | ||
python -m pip install --user --upgrade pip | ||
python -m pip install --upgrade setuptools wheel twine check-wheel-contents | ||
python -m pip --version | ||
- name: Build distributions | ||
run: ./scripts/build-dist.sh | ||
|
||
- name: Show distributions | ||
run: ls -lh dist/ | ||
|
||
- name: Check distribution descriptions | ||
run: | | ||
twine check dist/* | ||
- name: Check wheel contents | ||
run: | | ||
check-wheel-contents dist/*.whl --ignore W007,W008 | ||
- name: Check if this is an alpha version | ||
id: check-is-alpha | ||
- run: hatch build | ||
- run: hatch run build:check-all | ||
- id: check-is-alpha | ||
run: | | ||
export is_alpha=0 | ||
if [[ "$(ls -lh dist/)" == *"a1"* ]]; then export is_alpha=1; fi | ||
echo "is_alpha=$is_alpha" >> $GITHUB_OUTPUT | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: dist | ||
|
@@ -164,44 +92,22 @@ jobs: | |
|
||
test-build: | ||
name: verify packages / python ${{ matrix.python-version }} / ${{ matrix.os }} / ${{ matrix.dist-type }} | ||
|
||
if: needs.build.outputs.is_alpha == 0 | ||
|
||
needs: build | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, macos-14, windows-latest] | ||
python-version: ['3.9', '3.10', '3.11', '3.12'] | ||
dist-type: ['whl', 'gz'] | ||
|
||
steps: | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install python dependencies | ||
run: | | ||
python -m pip install --user --upgrade pip | ||
python -m pip install --upgrade wheel | ||
python -m pip --version | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: dist | ||
path: dist/ | ||
|
||
- name: Show distributions | ||
run: ls -lh dist/ | ||
|
||
- name: Install ${{ matrix.dist-type }} distributions | ||
run: | | ||
find ./dist/*.${{ matrix.dist-type }} -maxdepth 1 -type f | xargs python -m pip install --force-reinstall --find-links=dist/ | ||
- name: Check ${{ matrix.dist-type }} distributions | ||
run: | | ||
python -c "import dbt.adapters.snowflake" | ||
- run: find ./dist/*.${{ matrix.dist-type }} -maxdepth 1 -type f | xargs python -m pip install --force-reinstall --find-links=dist/ | ||
- run: python -c "import dbt.adapters.snowflake" |
Oops, something went wrong.