Glue different workflows. #109
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, workflow_call] | |
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 -e 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 | |
build-docker-image: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
- name: Set up services | |
run: | | |
docker-compose -f dev-env/docker-compose.yaml up -d --remove-orphans | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Build freva-storage-service image | |
uses: docker/build-push-action@v4 | |
with: | |
platforms: linux/amd64 | |
push: false | |
load: true | |
tags: databrowser | |
- name: Check databrowser image | |
run: python3 dev-env/check-container.py | |
dependabot: | |
name: Merge PR by dependabot | |
runs-on: ubuntu-latest | |
needs: [ci, docs, build-docker-image] | |
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}} |