-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (83 loc) · 2.87 KB
/
container-tests.yml
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
92
93
94
95
96
97
name: Container tests
defaults:
run:
shell: bash
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
# Only run when something changes in the actual containers
paths:
- "containers/**"
- ".github/workflows/**"
schedule:
- cron: '01 00 * * *'
workflow_dispatch:
inputs:
debug_enabled:
description: 'Run the build with tmate set "debug_enabled"'
type: boolean
required: false
default: false
testargs:
description: Add specific test to run like -run TestEnvironmentVariables or -run "(TestDdevFullSite.*|Test.*Pull)"
required: false
default: ""
env:
DDEV_IGNORE_EXPIRING_KEYS: "false"
# Unfortunately, we can't test forked PRs with the secret that's provided for this
# So it has to be hard-wired here. Needs to be switched back to "90" after mysql
# key is updated, see https://github.com/docker-library/mysql/issues/801
DDEV_MAX_DAYS_BEFORE_CERT_EXPIRATION: "90"
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: read
jobs:
container-build-and-test:
name: ${{ matrix.os }} - Test container ${{ matrix.containers }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04]
containers: [dbserver, webserver, others]
steps:
- uses: actions/checkout@v3
- run: echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
with:
limit-access-to-actor: true
github-token: ${{ secrets.GITHUB_TOKEN }}
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
- name: Install Docker and deps (Linux)
if: matrix.os == 'ubuntu-22.04'
run: ./.github/workflows/linux-setup.sh
- uses: actions/setup-go@v4
with:
go-version: '>=1.20'
- name: Build and test container ${{ matrix.containers }}
run: |
source ~/.bashrc
docker version
mkcert --version
set -eu -o pipefail
if [[ "${{ matrix.containers }}" == "dbserver" ]]; then
pushd containers/ddev-dbserver
echo "--- Test container dbserver"
time make test DOCKER_ARGS="--no-cache"
popd
elif [[ "${{ matrix.containers }}" == "webserver" ]]; then
pushd containers/ddev-webserver
echo "--- Test container ddev-webserver"
time make test DOCKER_ARGS="--no-cache"
popd
elif [[ "${{ matrix.containers }}" == "others" ]]; then
for dir in ddev-router ddev-ssh-agent test-ssh-server
do pushd containers/$dir
echo "--- Test container $dir"
time make test DOCKER_ARGS=--no-cache
popd
done
fi
set +eu