2026-06-08 12:31:42 +01:00
|
|
|
---
|
|
|
|
|
name: ci
|
|
|
|
|
on:
|
|
|
|
|
push:
|
|
|
|
|
branches:
|
|
|
|
|
- main
|
|
|
|
|
|
|
|
|
|
jobs:
|
2026-06-20 18:42:15 +01:00
|
|
|
ruff:
|
2026-06-08 12:31:42 +01:00
|
|
|
runs-on: docker
|
2026-06-09 09:34:45 +01:00
|
|
|
continue-on-error: true
|
2026-06-08 12:31:42 +01:00
|
|
|
container:
|
2026-06-08 14:09:06 +01:00
|
|
|
image: ghcr.io/astral-sh/uv:alpine
|
2026-06-08 12:31:42 +01:00
|
|
|
steps:
|
2026-06-08 14:45:54 +01:00
|
|
|
- run: apk add --no-cache nodejs npm git
|
2026-06-08 14:18:40 +01:00
|
|
|
- uses: actions/checkout@v4
|
2026-06-08 14:21:11 +01:00
|
|
|
with:
|
|
|
|
|
submodules: true
|
2026-06-08 12:31:42 +01:00
|
|
|
- run: uv python install # Gets Python version from pyproject.toml
|
2026-06-20 18:42:15 +01:00
|
|
|
- run: uv sync --dev
|
2026-06-08 14:47:33 +01:00
|
|
|
- run: uv run ruff check
|
2026-06-09 09:34:45 +01:00
|
|
|
- run: uv run ruff format
|
2026-06-20 18:42:15 +01:00
|
|
|
|
|
|
|
|
ty:
|
|
|
|
|
runs-on: docker
|
|
|
|
|
continue-on-error: true
|
|
|
|
|
container:
|
|
|
|
|
image: ghcr.io/astral-sh/uv:alpine
|
|
|
|
|
steps:
|
|
|
|
|
- run: apk add --no-cache nodejs npm git
|
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
|
with:
|
|
|
|
|
submodules: true
|
|
|
|
|
- run: uv python install # Gets Python version from pyproject.toml
|
|
|
|
|
- run: uv sync --dev
|
|
|
|
|
- run: uv run ty check
|
|
|
|
|
env:
|
|
|
|
|
ENVIRONMENT: testing
|
|
|
|
|
|
|
|
|
|
tests:
|
|
|
|
|
runs-on: docker
|
|
|
|
|
continue-on-error: true
|
|
|
|
|
container:
|
|
|
|
|
image: ghcr.io/astral-sh/uv:alpine
|
|
|
|
|
steps:
|
|
|
|
|
- run: apk add --no-cache nodejs npm git
|
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
|
with:
|
|
|
|
|
submodules: true
|
|
|
|
|
- run: uv python install # Gets Python version from pyproject.toml
|
|
|
|
|
- run: uv sync --dev
|
2026-06-08 12:31:42 +01:00
|
|
|
- run: uv run pytest test
|
|
|
|
|
env:
|
|
|
|
|
ENVIRONMENT: testing
|
2026-06-22 14:38:11 +01:00
|
|
|
|
|
|
|
|
build:
|
|
|
|
|
needs: [ ruff, ty, tests ]
|
|
|
|
|
if: ${{ always() && needs.ruff.result == 'success' && needs.ty.result == 'success' && needs.tests.result == 'success' }}
|
2026-06-22 15:18:13 +01:00
|
|
|
runs-on: docker
|
2026-06-22 14:38:11 +01:00
|
|
|
container:
|
|
|
|
|
image: ghcr.io/catthehacker/ubuntu:act-latest
|
|
|
|
|
options: -v /dind/docker.sock:/var/run/docker.sock
|
|
|
|
|
steps:
|
|
|
|
|
- name: Checkout the repo
|
|
|
|
|
uses: actions/checkout@v4
|
2026-06-22 15:20:14 +01:00
|
|
|
- name: Checkout the frontend
|
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
with:
|
|
|
|
|
repository: https://guardianproject.dev/sr2/cloud-portal.git
|
|
|
|
|
path: frontend
|
2026-06-22 14:38:11 +01:00
|
|
|
- name: Set up Docker Buildx
|
|
|
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
|
- name: Login to the registry
|
|
|
|
|
uses: docker/login-action@v3
|
|
|
|
|
with:
|
|
|
|
|
registry: guardianproject.dev
|
|
|
|
|
username: irl
|
|
|
|
|
password: ${{ secrets.PACKAGE_TOKEN }}
|
|
|
|
|
- name: Build and push
|
|
|
|
|
uses: docker/build-push-action@v6
|
|
|
|
|
with:
|
|
|
|
|
file: Containerfile
|
|
|
|
|
push: true
|
2026-06-22 15:21:31 +01:00
|
|
|
tags: guardianproject.dev/${{ github.repository }}:${{ github.ref }}
|