Update tox #84
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: CI Tests | |
permissions: | |
pull-requests: write | |
on: [push, pull_request] | |
jobs: | |
ci: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.11" | |
- name: Set up services | |
run: | | |
docker-compose -f dev-env/docker-compose.yaml up -d --remove-orphans | |
- name: Install dependencies | |
run: | | |
python3 -m pip install tox | |
- name: Run all tests with tox | |
run: tox -p 3 | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: true | |
verbose: true | |
flags: unittests | |
docs: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.11" | |
- name: Set up services | |
run: | | |
docker-compose -f dev-env/docker-compose.yaml up -d --remove-orphans | |
- name: Install dependencies | |
run: | | |
python3 -m pip install tox | |
- name: Creating docs | |
run: tox docs | |
- name: Setup Pages | |
uses: actions/configure-pages@v2 | |
- name: Upload artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
# Upload entire repository | |
path: './docs/build/html' | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./docs/build/html | |
dependabot: | |
name: Merge PR by dependabot | |
runs-on: ubuntu-latest | |
needs: [ci, docs] | |
if: github.event.pull_request.user.login == 'dependabot[bot]' | |
steps: | |
- name: Dependabot metadata | |
id: metadata | |
uses: dependabot/fetch-metadata@v1 | |
with: | |
github-token: "${{ secrets.GITHUB_TOKEN }}" | |
- name: Approve dependabot's PR | |
run: gh pr review --approve "$PR_URL" | |
env: | |
PR_URL: ${{github.event.pull_request.html_url}} | |
GITHUB_TOKEN: ${{secrets.TOKEN}} | |
- name: Auto-merge for dependabot's PR | |
run: gh pr merge --merge --auto "$PR_URL" | |
env: | |
PR_URL: ${{github.event.pull_request.html_url}} | |
GITHUB_TOKEN: ${{secrets.TOKEN}} |