Bug fixes. #967
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: | |
lint-and-docs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Set up Python "3.X" | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.X" | |
- name: Install dependencies | |
run: | | |
python3 -m pip install -e ./freva-rest[dev] -e ./freva-data-portal-worker[full] | |
- name: Generate self signed keys | |
run: python dev-env/config/dev-utils.py gen-certs | |
- name: Set up services | |
run: | | |
docker compose -f dev-env/docker-compose.yaml up -d --remove-orphans | |
- name: Waiting for keycloak | |
run: > | |
python dev-env/config/dev-utils.py oidc | |
http://localhost:8080/realms/freva/.well-known/openid-configuration | |
- name: Starting the local server | |
run: | | |
python run_server.py --config dev-env/api_config.toml --debug --dev -p 7777 | |
- name: Linting, type checking and docs with tox | |
run: tox run-parallel --parallel-no-spinner | |
tests: | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 5 | |
matrix: | |
python-version: [3.9, "3.10", "3.11", "3.12", "3.13"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{matrix.python-version}} | |
- name: Install dependencies | |
run: | | |
python3 -m pip install -e ./freva-rest[dev] -e ./freva-data-portal-worker[full] | |
- name: Generate self signed keys | |
run: python dev-env/config/dev-utils.py gen-certs | |
- name: Set up services | |
run: | | |
docker compose -f dev-env/docker-compose.yaml up -d --remove-orphans | |
- name: Waiting for keycloak | |
run: > | |
python dev-env/config/dev-utils.py oidc | |
http://localhost:8080/realms/freva/.well-known/openid-configuration | |
- name: Run tests | |
run: tox -e test | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
verbose: true | |
build-docker-image: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
- name: Generate self signed keys | |
run: python dev-env/config/dev-utils.py gen-certs | |
- name: Set up services | |
run: | | |
docker compose -f dev-env/docker-compose.yaml up -d redis ldap keycloak --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: | |
context: freva-rest | |
file: freva-rest/Dockerfile | |
platforms: linux/amd64 | |
push: false | |
load: true | |
no-cache: true | |
tags: freva-rest:latest | |
- name: Waiting for keycloak | |
run: > | |
python dev-env/config/dev-utils.py oidc | |
http://localhost:8080/realms/freva/.well-known/openid-configuration | |
- name: Check databrowser image | |
run: python3 dev-env/check-container.py | |
dependabot: | |
name: Merge PR by dependabot | |
runs-on: ubuntu-latest | |
needs: [tests, lint-and-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}} |