Skip to content

Merge pull request #2290 from opensafely-core/search-component #4100

Merge pull request #2290 from opensafely-core/search-component

Merge pull request #2290 from opensafely-core/search-component #4100

Workflow file for this run

---
name: Test and build Docker image
on:
push:
workflow_call:
workflow_dispatch:
jobs:
lint-dockerfile:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: hadolint/hadolint-action@54c9adbab1582c2ef04b2016b760714a4bfde3cf # v3.1.0
with:
dockerfile: docker/Dockerfile
check-py:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: opensafely-core/setup-action@v1
with:
install-just: true
- name: Build docker image and run checks in it
run: |
# build docker and run checks
just docker-check-py
check-js:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: opensafely-core/setup-action@v1
with:
install-just: true
- name: Build docker image and run checks in it
run: |
# build docker and run checks
just docker-check-js
test-py:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: opensafely-core/setup-action@v1
with:
install-just: true
- name: Build docker image for both prod and dev
run: |
just docker-build prod
just docker-build dev
- name: Run unit tests on docker dev image
run: |
# build docker and run test
just docker-test-py
- name: Run smoke test on prod
run: |
just docker-serve prod -d
sleep 5
just docker-smoke-test || { docker logs docker_prod_1; exit 1; }
- name: Save docker image
run: |
docker save opencodelists | zstd --fast -o /tmp/opencodelists.tar.zst
- name: Upload docker image
uses: actions/upload-artifact@v4
with:
name: opencodelists-image
path: /tmp/opencodelists.tar.zst
compression-level: 0
test-js:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: opensafely-core/setup-action@v1
with:
install-just: true
- name: Build docker image and run JS tests in it
run: |
# build docker and run test
just docker-test-js