GH-3: Add IT for OAuth callback #116
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 | |
on: | |
push: | |
branches: [ main ] | |
tags: [ '*' ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Create virtual environment | |
run: python3 -m venv .venv | |
- name: Build web assets | |
run: npm install && npm run build | |
- name: Install dependencies | |
run: .venv/bin/pip install .[dev] | |
- name: Install browsers | |
run: .venv/bin/playwright install --with-deps chromium | |
- name: Run format check | |
run: make format-check | |
- name: Run type check | |
run: make mypy | |
- name: Run linter | |
run: make pylint | |
- name: Run tests | |
run: make test | |
- name: Upload screenshots on test failures | |
uses: actions/upload-artifact@v3 | |
if: failure() | |
with: | |
name: screenshots | |
path: test-results | |
- id: auth | |
name: Authenticate with Google Cloud | |
uses: google-github-actions/auth@v1 | |
with: | |
token_format: access_token | |
credentials_json: '${{ secrets.GCP_CREDENTIALS_CI }}' | |
- name: Login to Docker repository | |
uses: docker/login-action@v3 | |
with: | |
registry: europe-west1-docker.pkg.dev | |
username: oauth2accesstoken | |
password: ${{ steps.auth.outputs.access_token }} | |
- id: meta | |
name: Extract metadata | |
uses: docker/metadata-action@v5 | |
with: | |
images: europe-west1-docker.pkg.dev/dft-ate-schemes/docker/schemes | |
tags: | | |
type=semver,pattern={{version}} | |
type=raw,value=latest,enable={{is_default_branch}} | |
- name: Build and push image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
push: true |