Skip to content

test6

test6 #17

Workflow file for this run

name: CI
on:
workflow_dispatch:
push:
permissions:
contents: read
packages: write
jobs:
tests:
runs-on: ubuntu-22.04
strategy:
matrix:
version: [v1, v2]
steps:
- uses: actions/checkout@v4
- uses: "opensafely-core/setup-action@v1"
with:
install-just: true
- name: Install uv
uses: astral-sh/setup-uv@4db96194c378173c656ce18a155ffc14a9fc4355
- name: Cache Docker buildx caches
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
# packages.toml is v2+
# renv.lock is v1 only
# |- joins w/o spaces and strips newlntes
key: |-
${{ runner.os }}-${{ matrix.version }}-buildx-
${{ hashFiles('${{ matrix.version }}/packages.toml', '${{ matrix.version }}/renv.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.version }}-buildx-
lookup-only: false
enableCrossOsArchive: true
save-always: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f7ce87c1d6bead3e36075b2ce75da1f6cc28aaca
- name: check
run: just check
- name: Build image
run: just build ${{ matrix.version }}
- name: Run tests
run: just test ${{ matrix.version }}
- name: Build rstudio
run: just build-rstudio ${{ matrix.version }}
- name: Test rstudio
run: |
just _env # ideally needs creating before we run the tests
just test-rstudio ${{ matrix.version }}
- name: Log into GitHub Container Registry
if: github.ref == 'refs/heads/main'
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login https://ghcr.io -u ${{ github.actor }} --password-stdin
- name: Publish images
if: github.ref == 'refs/heads/main'
run:
just publish ${{ matrix.version }}
just publish-rstudio ${{ matrix.version }}