diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..e973e20 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,78 @@ +name: build +on: + push: + pull_request: + schedule: # nightly build + - cron: '0 0 * * *' + +jobs: +# enable the following mypy job once it is added to tox +# +# mypy: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v2 +# - uses: actions/setup-python@v2 +# - run: python -m pip install tox +# - run: python -m tox -e mypy + + test: + strategy: + matrix: + tox-env: ["py"] + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + include: + - python-version: "3.11" + tox-env: "lint" + name: "lint" + - python-version: "3.8" # match readthedocs + tox-env: "docs" + name: "docs" + - python-version: "3.11" + tox-env: "py-marshmallowdev" + name: "test marshmallow 'dev' on py3.11" + - python-version: "3.7" + tox-env: "py-mindeps" + name: "test mindeps on py3.7" + name: "${{ matrix.name || format('test py{0}', matrix.python-version ) }}" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - run: python -m pip install tox + - run: python -m tox -e ${{ matrix.tox-env }} + +# TODO: +# the following config is copied from the webargs release process and should be applicable here +# however, it needs credentials in the project repo to publish, and it may be possible to refine +# this into something even better +# +# +# # this duplicates pre-commit.ci, so only run it on tags +# # it guarantees that linting is passing prior to a release +# lint-pre-release: +# if: startsWith(github.ref, 'refs/tags') +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v2 +# - uses: actions/setup-python@v2 +# - run: python -m pip install tox +# - run: python -m tox -e lint +# +# release: +# needs: [mypy, test, lint-pre-release] +# runs-on: ubuntu-latest +# if: startsWith(github.ref, 'refs/tags') +# steps: +# - uses: actions/checkout@v2 +# - uses: actions/setup-python@v2 +# - name: install requirements +# run: python -m pip install build twine +# - name: build dists +# run: python -m build +# - name: check package metadata +# run: twine check dist/* +# - name: publish +# run: twine upload -u __token__ -p ${{ secrets.PYPI_API_TOKEN }} dist/* diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 90c147c..aabb0ae 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,6 +4,11 @@ repos: hooks: - id: pyupgrade args: [--py37-plus] +- repo: https://github.com/python-jsonschema/check-jsonschema + rev: 0.21.0 + hooks: + - id: check-github-workflows + - id: check-readthedocs - repo: https://github.com/python/black rev: 23.1.0 hooks: diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 9d47f1a..0000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,46 +0,0 @@ -trigger: - branches: - include: [dev, test-me-*] - tags: - include: ['*'] - - # Run builds nightly to catch incompatibilities with new marshmallow releases -schedules: -- cron: "0 0 * * *" - displayName: Daily midnight build - branches: - include: - - dev - always: "true" - -resources: - repositories: - - repository: sloria - type: github - endpoint: github - name: sloria/azure-pipeline-templates - ref: refs/heads/sloria - -jobs: -- template: job--python-tox.yml@sloria - parameters: - toxenvs: - - lint - - - py37 - - py38 - - py39 - - py310 - - py311 - - - py37-lowest - - py311-marshmallowdev - - - docs - os: linux -- template: job--pypi-release.yml@sloria - parameters: - python: "3.9" - distributions: "sdist bdist_wheel" - dependsOn: - - tox_linux