Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-48471 : Create Release 0.2.0 #159

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 15 additions & 27 deletions .github/workflows/build_and_push.yaml
Original file line number Diff line number Diff line change
@@ -1,31 +1,28 @@
# A workflow that builds and (optionally) pushes the Docker container image
# artifacts for the application. The build action occurs on pull request events
# that target the `main` branch, and the push action occurs only with tagged releases
# and ticket branches.
# A workflow that builds and pushes the Docker container image artifacts for
# the application. The action occurs on new tags and when called from another
# workflow.
---
name: "Build and Push"

"on":
pull_request:
branches:
- main
paths:
- 'src/lsst/cmservice/**'
push:
tags:
- "*"
workflow_call:
workflow_dispatch:

jobs:
ci:
uses:
./.github/workflows/ci.yaml

build:
name: "Build and Push Application Container Images"
needs:
- ci
runs-on: ubuntu-latest
strategy:
matrix:
include:
- target: cmservice
image: ${{ github.repository_owner }}/cm-service
- target: cmworker
image: ${{ github.repository_owner }}/cm-worker
timeout-minutes: 20

steps:
Expand All @@ -34,19 +31,10 @@ jobs:
fetch-depth: 0

- uses: lsst-sqre/build-and-push-to-ghcr@v1
id: build-service
with:
dockerfile: docker/Dockerfile
target: cmservice
image: ${{ github.repository }}
target: ${{ matrix.target }}
platforms: linux/amd64,linux/arm64
image: ${{ matrix.image }}
github_token: ${{ secrets.GITHUB_TOKEN }}
push: ${{ github.ref_type == 'tag' || (github.ref_type == 'branch' && startsWith(github.ref_name, 'tickets/DM-')) }}

- uses: lsst-sqre/build-and-push-to-ghcr@v1
id: build-worker
with:
dockerfile: docker/Dockerfile
target: cmworker
image: ${{ github.repository }}
github_token: ${{ secrets.GITHUB_TOKEN }}
push: ${{ github.ref_type == 'tag' || (github.ref_type == 'branch' && startsWith(github.ref_name, 'tickets/DM-')) }}
push: true
38 changes: 28 additions & 10 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# and when called from another workflow.
---
name: "CI"

"on":
workflow_call:
push:
Expand All @@ -13,8 +14,14 @@ env:
UV_FROZEN: "1"

jobs:
rebase-checker:
uses:
./.github/workflows/rebase_checker.yaml

lint:
runs-on: ubuntu-latest
needs:
- rebase-checker
steps:

- name: Checkout Repository
Expand All @@ -28,50 +35,61 @@ jobs:
- name: Run pre-commit
uses: pre-commit/[email protected]

test:
mypy:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"]
needs:
- rebase-checker
steps:

- name: Checkout Repository
uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: "0.5.x"
enable_cache: true
enable-cache: true
python-version: ${{ matrix.python-version }}

- name: Install packages for testing
run: uv sync --dev --frozen

- name: Run tests
run: |
uv run playwright install
uv run make test
run: uv run make typing

mypy:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"]

needs:
- lint
- mypy
steps:

- name: Checkout Repository
uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: "0.5.x"
enable_cache: true
enable-cache: true
python-version: ${{ matrix.python-version }}

- name: Install packages for testing
run: uv sync --dev --frozen

- name: Run tests
run: uv run make typing
run: |
uv run playwright install
uv run make test


build-and-push:
needs:
- test
if: ${{ startsWith(github.ref_name, 'tickets/DM-') }}
uses: ./.github/workflows/build_and_push.yaml
6 changes: 4 additions & 2 deletions .github/workflows/rebase_checker.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
---
name: Check that 'main' is not merged into the development branch
name: Rebase Checker

on: pull_request
"on":
workflow_call:
pull_request:

jobs:
call-workflow:
Expand Down
Loading