Skip to content

Fix ci

Fix ci #5543

Workflow file for this run

name: CI
on:
push:
branches:
- master
- 'dev/**'
tags:
- '[0-9]+.[0-9]+.[0-9]+'
pull_request:
jobs:
preliminary:
runs-on: ubuntu-latest
outputs:
check_doc_modified: ${{steps.check_doc_modified.outcome}}
check_changelog_modified: ${{steps.check_changelog_modified.outcome}}
steps:
- name: Checkout Master
uses: actions/checkout@v2
with:
ref: master
fetch-depth: 1000
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 1000
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pkgmt
- name: Check Doc Modified
id: check_doc_modified
run: |
if [ "$GITHUB_EVENT_NAME" == "pull_request" ]
then
echo "Pull request, running check_doc"
python -m pkgmt.fail_if_modified -b origin/master -e doc CHANGELOG.md
else
echo "This is not a pull request event"
echo "Running all tests"
exit 1
fi
continue-on-error: true
- name: Check Changelog Modified
env:
labels_JSON: ${{ toJSON(github.event.pull_request.labels.*.name) }}
id: check_changelog_modified
run: |
if [ "$GITHUB_EVENT_NAME" == "pull_request" ]
then
# Check if the array contains "no-changelog"
if echo "$labels_JSON" | jq '. | contains(["no-changelog"])' | grep -q true; then
echo "PR contains no-changelog label"
else
echo "PR does not contain no-changelog label";
echo "Checking if changelog is modified";
echo "If this test fails, please add the no-changelog label to the PR or modify the changelog"
python -m pkgmt.fail_if_not_modified -b origin/master -i CHANGELOG.md
fi
else
exit 0
fi
integration-test-non-live:
needs: [preliminary]
if: needs.preliminary.outputs.check_doc_modified == 'failure'
uses: ./.github/workflows/ci-integration-db.yaml
test:
needs: [preliminary]
if: needs.preliminary.outputs.check_doc_modified == 'failure'
strategy:
matrix:
python-version: [3.8, 3.9, '3.10', '3.11']
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
env:
PLOOMBER_VERSION_CHECK_DISABLED: true
PYTHON_VERSION: ${{ matrix.python-version }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Lint
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade pkgmt codespell nox
pkgmt lint
codespell
- name: Install dependencies
run: |
nox --session test_unit --install-only
- name: Test with pytest
run: |
nox --session test_unit --no-install --reuse-existing-virtualenvs
- name: Upload failed images artifacts
uses: actions/upload-artifact@v3
if: failure()
with:
name: failed-image-artifacts ${{ matrix.os }} ${{ matrix.python-version }}
path: result_images/
test-sqlalchemy-v1:
needs: [preliminary]
if: needs.preliminary.outputs.check_doc_modified == 'failure'
strategy:
matrix:
python-version: ['3.11']
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
env:
PLOOMBER_VERSION_CHECK_DISABLED: true
PYTHON_VERSION: ${{ matrix.python-version }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Lint
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade pkgmt nox
pkgmt lint
- name: Install dependencies
run: |
nox --session test_unit_sqlalchemy_one --install-only
- name: Test with pytest
run: |
nox --session test_unit_sqlalchemy_one --no-install --reuse-existing-virtualenvs
- name: Upload failed images artifacts sqlalchemyv1
uses: actions/upload-artifact@v3
if: failure()
with:
name: failed-image-artifacts-sqlalchemy ${{ matrix.os }} ${{ matrix.python-version }}
path: result_images/
# run: pkgmt check
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install 'pkgmt[check]'
- name: Check project
run: |
pkgmt check
release:
needs: [test, test-sqlalchemy-v1, check, integration-test-non-live]
if: startsWith(github.ref, 'refs/tags') && github.event_name != 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install pkgmt twine wheel --upgrade
- name: Release
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
TAG: ${{ github.ref_name }}
run: |
echo "tag is $TAG"
pkgmt release $TAG --production --yes