Skip to content
Merged
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
31 changes: 1 addition & 30 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,36 +51,7 @@ jobs:
run: make docs
run_test:
needs: run_lint
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15
env:
POSTGRES_DB: testdb
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres # pragma: allowlist secret
POSTGRES_HOST_AUTH_METHOD: trust
LC_COLLATE: en_US.UTF8
LC_CTYPE: en_US.UTF8
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v7
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
python-version: "3.14.6"
- name: Install dependencies
run: make install
- name: Run tests
run: make test
uses: ./.github/workflows/test.yaml

cronjobs-test:
needs: run_test
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ingestion-job-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# publish: $\{{ github.event_name != 'pull_request' }}
# ```
#
name: Build and Publish Docker Container
name: Build and Publish Ingestion Docker Container

on:
workflow_call:
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,16 @@ jobs:
check browser_tests '^.github/workflows/|^browser-tests/'
check git_reader '^.github/workflows/|^git-reader/'

# Make sure we don't deploy images with failing tests.
# On pull-requests, tests are already ran in CI.
tests:
if: github.event_name != 'pull_request'
uses: ./.github/workflows/test.yaml

server_container:
# Always build the server (since it depends on lots of files uv.lock, dockerfiles, kinto-slack, etc.)
needs: tests
if: ${{ !cancelled() && needs.tests.result != 'failure' }}
env:
DOCKERHUB_IMAGE_NAME: mozilla/remote-settings
GAR_IMAGE_NAME: remote-settings
Expand Down Expand Up @@ -184,7 +192,7 @@ jobs:
SRC: ${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.GCP_PROJECT_ID }}/${{ env.GAR_REPOSITORY}}/remote-settings:${{ env.LATEST_TAG }}
run: |
for tag in $TAGS; do
docker buildx imagetools create --tag "${tag}" "${SRC}"
docker buildx imagetools create --tag "${tag}" "${SRC}"
done
- name: Notify DEVs of build failure
if: failure()
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Tests

# Reusable workflow so the exact same test suite gates both CI checks
# (ci.yaml) and the deployable image build (publish.yaml).
on:
workflow_call:

permissions:
contents: read

jobs:
run_test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15
env:
POSTGRES_DB: testdb
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres # pragma: allowlist secret
POSTGRES_HOST_AUTH_METHOD: trust
LC_COLLATE: en_US.UTF8
LC_CTYPE: en_US.UTF8
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v7
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
python-version: "3.14.6"
- name: Install dependencies
run: make install
- name: Run tests
run: make test
Loading