Skip to content
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
28 changes: 28 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Docker build

on:
workflow_call:
workflow_dispatch:

permissions:
contents: read

jobs:
lambda-build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0

- name: Test Refiner Lambda build
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0
with:
context: .
file: docker/lambda.Dockerfile
push: false
platforms: linux/amd64
cache-from: type=gha
cache-to: type=gha,mode=max
40 changes: 40 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Run linter & format check

on:
workflow_call:
workflow_dispatch:

permissions:
contents: read

jobs:
ruff:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0

- name: "Set up Python"
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version-file: "pyproject.toml"

- name: Install uv
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
with:
version-file: "pyproject.toml"
enable-cache: true

- name: Install the project
run: uv sync --all-packages --locked --all-extras --dev

- name: Run ruff linter
shell: bash
run: |
uv run ruff check

- name: Run ruff format check
shell: bash
run: |
uv run ruff format --check
30 changes: 30 additions & 0 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: PR Pipeline

on:
pull_request:
branches:
- "**"
merge_group:
types:
- checks_requested
push:
branches:
- main
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
run-linter:
uses: ./.github/workflows/lint.yml
run-tests:
uses: ./.github/workflows/tests.yml
run-type-checking:
uses: ./.github/workflows/typecheck.yml
run-build:
uses: ./.github/workflows/build.yml
13 changes: 6 additions & 7 deletions .github/workflows/pr-security-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ name: PR Security Scan

on:
workflow_dispatch:
# TODO: uncomment this trigger block when we want this workflow to run on PRs
# pull_request:
# branches:
# - "**"
# merge_group:
# types:
# - checks_requested
pull_request:
branches:
- "**"
merge_group:
types:
- checks_requested

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: Run tests

on:
workflow_dispatch
workflow_call:
workflow_dispatch:

permissions:
contents: read
Expand All @@ -12,16 +13,17 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v6
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0

- name: "Set up Python"
uses: actions/setup-python@v6
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version-file: "pyproject.toml"

- name: Install uv
uses: astral-sh/setup-uv@v7
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
with:
version-file: "pyproject.toml"
enable-cache: true

- name: Install the project
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/typecheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Run typechecker

on:
workflow_call:
workflow_dispatch:

permissions:
contents: read

jobs:
ty:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0

- name: "Set up Python"
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version-file: "pyproject.toml"

- name: Install uv
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
with:
version-file: "pyproject.toml"
enable-cache: true

- name: Install the project
run: uv sync --all-packages --locked --all-extras --dev

- name: Run ty typecheck
shell: bash
run: |
uv run ty check
2 changes: 1 addition & 1 deletion docker/lambda.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM public.ecr.aws/lambda/python:3.14 AS builder
WORKDIR ${LAMBDA_TASK_ROOT}

# copy uv binary from uv image
COPY --from=ghcr.io/astral-sh/uv:0.10.9 /uv /bin/uv
COPY --from=ghcr.io/astral-sh/uv:0.11.31 /uv /bin/uv

# copy dependency manifests
COPY uv.lock pyproject.toml ./
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ dev = [
"ty>=0.0.21",
]

[tool.uv]
required-version = ">=0.11.31"

[tool.uv.workspace]
members = ["packages/*"]

Expand Down
Loading