-
Notifications
You must be signed in to change notification settings - Fork 143
91 lines (86 loc) · 3.21 KB
/
test-1.6.yml
File metadata and controls
91 lines (86 loc) · 3.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: Build & Test
permissions:
contents: read
on:
pull_request:
paths:
- apache-1.6.x/**
- fpm-1.6.x/**
- fpm-alpine-1.6.x/**
- .github/workflows/*-1.6.yml
jobs:
build-and-testvariants:
name: Build image variants and run tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 10
matrix:
include:
- variant: 'apache'
test-files: 'apache-postgres'
docker-tag: roundcube/roundcubemail:test-apache
docker-tag-nonroot: roundcube/roundcubemail:test-apache-nonroot
http-port-nonroot: '8000'
- variant: 'fpm'
test-files: 'fpm-postgres'
docker-tag: roundcube/roundcubemail:test-fpm
docker-tag-nonroot: roundcube/roundcubemail:test-fpm-nonroot
- variant: 'fpm-alpine'
test-files: 'fpm-postgres'
docker-tag: roundcube/roundcubemail:test-fpm-alpine
docker-tag-nonroot: roundcube/roundcubemail:test-fpm-alpine-nonroot
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Docker
# This step is required to enable the containerd image store, which is required by the cache type=gha
uses: docker/setup-docker-action@efe9e3891a4f7307e689f2100b33a155b900a608 # v4.5.0
with:
daemon-config: |
{
"debug": true,
"features": {
"containerd-snapshotter": true
}
}
- name: Build rootful image for "${{ matrix.variant }}"
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
with:
context: ${{ matrix.variant }}
load: true
tags: ${{ matrix.docker-tag }}
target: root
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Test rootful image
env:
ROUNDCUBEMAIL_TEST_IMAGE: ${{ matrix.docker-tag }}
HTTP_PORT: '80'
run: |
set -exu;
for testFile in ${{ join(matrix.test-files, ' ') }};
do
docker compose -f ./tests/docker-compose.test-${testFile}.yml down -v
docker compose -f ./tests/docker-compose.test-${testFile}.yml up --exit-code-from=sut --abort-on-container-exit
done
- name: Build nonroot image for "${{ matrix.variant }}"
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
with:
context: ${{ matrix.variant }}
load: true
tags: ${{ matrix.docker-tag-nonroot }}
target: nonroot
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Test nonroot image
env:
ROUNDCUBEMAIL_TEST_IMAGE: ${{ matrix.docker-tag-nonroot }}
HTTP_PORT: ${{ matrix.http-port-nonroot || '80' }}
run: |
set -exu;
for testFile in ${{ join(matrix.test-files, ' ') }};
do
docker compose -f ./tests/docker-compose.test-${testFile}.yml down -v
docker compose -f ./tests/docker-compose.test-${testFile}.yml up --exit-code-from=sut --abort-on-container-exit
done