Skip to content
Closed
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
35 changes: 25 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: ci

on:
- push
- pull_request
push:
branches: [ main, develop ]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have a branch called develop?

pull_request:

jobs:
test:
Expand All @@ -13,16 +14,30 @@ jobs:
base_image: ["ubuntu:noble", "debian:bookworm"]

steps:
- uses: actions/checkout@v2
- name: Checkout code
uses: actions/checkout@v4

- name: Check available cgroups
run: |
mount | grep cgroup
- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.docker-cache

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any particular reason for naming the directory with a dot? Just /tmp/docker-cache would seem more straightforward.

key: ${{ runner.os }}-docker-${{ hashFiles('**/Dockerfile') }}
restore-keys: |
${{ runner.os }}-docker-

- name: Build docker image
run: |
docker compose -p cms -f docker/docker-compose.test.yml build \
--build-arg BASE_IMAGE=${{ matrix.base_image }} testcms
- name: Set up Docker buildx
uses: docker/setup-buildx-action@v3

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
push: false
tags: testcms
cache-from: type=local,src=/tmp/.docker-cache
cache-to: type=local,dest=/tmp/.docker-cache
build-args: BASE_IMAGE=${{ matrix.base_image }}

- name: Run tests
run: |
Expand Down