feat: New structure for 1.x.x #267
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: Lint and Test | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main, new-1.x.x ] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref_name || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
package-lint: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ['3.9', '3.10', '3.11', '3.12'] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' # caching pip dependencies | |
- name: Install dependencies | |
run: | | |
python -m pip install -e .[test] | |
- name: Run linters | |
run: make lint | |
package-test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ['3.9', '3.10', '3.11', '3.12'] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' # caching pip dependencies | |
- name: Install dependencies | |
run: | | |
python -m pip install -e .[test] | |
- name: Run all tests | |
run: make test | |
- name: Upload coverage | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos | |
files: coverage.xml | |
flags: unittests # optional | |
fail_ci_if_error: true # optional (default = false) | |
verbose: true # optional (default = false) | |
package-build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ['3.9', '3.10', '3.11', '3.12'] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' # caching pip dependencies | |
- name: Install dependencies | |
run: | | |
python -m pip install wheel | |
- name: Build wheel | |
run: | | |
# TODO: replace with make build | |
python -m pip wheel . --no-deps --wheel-dir dist | |
docker-build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ['3.9', '3.10', '3.11', '3.12'] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build docker image | |
run: | | |
docker build --build-arg PYTHON_VERSION=${{ matrix.python-version }} -t manytask-checker:${{ github.sha }} . | |
- name: Test run --help in docker image | |
run: | | |
docker run --rm manytask-checker:${{ github.sha }} --help | |
docs-test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.12 | |
cache: 'pip' # caching pip dependencies | |
- name: Install dependencies | |
run: | | |
python -m pip install -e .[docs] | |
- name: Build docs | |
run: | | |
make docs-build | |
# publish dev docs on push to main | |
docs-deploy-dev: | |
permissions: | |
contents: write | |
deployments: write | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/main' && github.event_name == 'push' | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.12 | |
cache: 'pip' # caching pip dependencies | |
- name: Install dependencies | |
run: | | |
python -m pip install -e .[docs] | |
- name: Docs deploy | |
run: | | |
make docs-deploy-dev | |
docs-preview: | |
permissions: | |
deployments: write | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.12 | |
cache: 'pip' # caching pip dependencies | |
- name: Install dependencies | |
run: | | |
python -m pip install -e .[docs] | |
- name: Docs preview | |
run: | | |
make docs-build | |
- name: Publish to Cloudflare Pages | |
id: deploy | |
uses: cloudflare/pages-action@v1 | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
projectName: manytask-checker | |
directory: ./site | |
# Optional: Enable this if you want to have GitHub Deployments triggered | |
gitHubToken: ${{ secrets.GITHUB_TOKEN }} | |
# Optional: Switch what branch you are publishing to. | |
# By default this will be the branch which triggered this workflow | |
branch: ${{ ( github.event.workflow_run.head_repository.full_name == github.repository && github.event.workflow_run.head_branch == 'main' && 'main' ) || ( github.event.workflow_run.head_sha ) }} |