-
Notifications
You must be signed in to change notification settings - Fork 0
150 lines (126 loc) · 4.3 KB
/
colima-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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
name: Colima tests
on:
pull_request:
paths:
- "go.*"
- "pkg/**"
- "cmd/**"
- "Makefile"
- "vendor/**"
- ".github/workflows/**"
push:
branches: [ main, master ]
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: ""
defaults:
run:
shell: bash
env:
DDEV_DEBUG: true
DDEV_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DDEV_SKIP_NODEJS_TEST: "true"
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: read
jobs:
tests:
name: colima-${{ matrix.tests }}-no-bind-mounts=${{ matrix.no-bind-mounts }}
strategy:
matrix:
webserver: [nginx-fpm]
tests: [ test ]
os: [ macos-13 ]
no-bind-mounts: ['false']
fail-fast: true
runs-on: ${{ matrix.os }}
env:
DDEV_TEST_WEBSERVER_TYPE: ${{ matrix.webserver }}
DDEV_NONINTERACTIVE: "true"
DDEV_TEST_NO_BIND_MOUNTS: ${{ matrix.no-bind-mounts }}
DDEV_TEST_USE_MUTAGEN: "true"
GOTEST_SHORT: "true"
steps:
- uses: actions/checkout@v4
- name: Get Date
id: get-date
run: |
echo "date=$(/bin/date -u "+%Y%V")" >> $GITHUB_OUTPUT
shell: bash
- name: DDEV test cache/restore
uses: actions/cache/restore@v4
with:
path: ~/.ddev/testcache/tarballs
key: ddev-test-cache-${{ steps.get-date.outputs.date }}
restore-keys: |
ddev-test-cache-
- uses: actions/setup-go@v5
with:
go-version: '>=1.21'
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
- run: echo "/usr/local/opt/mysql-client/bin" >> $GITHUB_PATH
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
with:
limit-access-to-actor: true
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
- name: Fix Python conflicts between macOS runner and Homebrew
run: |
# see https://github.com/actions/setup-python/issues/577
brew list -1 | grep python | while read formula; do brew unlink $formula; brew link --overwrite $formula; done
- name: Install homebrew dependencies
run: |
set -x
sudo chmod ugo+w /usr/local/bin
brew install docker docker-compose lima mysql-client
- name: Install and start Colima
run: |
brew install colima
colima version
colima start --cpu 3 --memory 6 --disk 100 --vm-type=qemu --mount-type=sshfs --dns=1.1.1.1
colima restart
- name: Build ddev
run: |
make
ln -s $PWD/.gotmp/bin/darwin_amd64/ddev /usr/local/bin/ddev
- name: Basic ddev usage
run: |
mkdir -p ~/workspace/d9 && cd ~/workspace/d9
ddev config --project-type=drupal9 --docroot=web
ddev debug download-images
ddev poweroff
docker buildx prune -f -a || true
docker rm -f $(docker ps -aq) >/dev/null || true
docker rmi -f $(docker images | awk '/[-]built/ { print $3 }') >/dev/null || true
# Pre-cache these so we don't see a mess in the later pull
for image in schickling/beanstalkd:latest memcached:1.5 solr:8; do
docker pull $image
done >/dev/null
- name: "show versions"
run: "set -x && ddev version && docker version && go version && colima version"
- name: time make "${{ matrix.tests }}"
run: |
echo "DDEV_TEST_USE_MUTAGEN=${DDEV_TEST_USE_MUTAGEN}"
echo "TESTARGS='${{ github.event.inputs.testargs }}'"
echo "mkcert_caroot=$(grep mkcert_caroot ~/.ddev/global_config.yaml)"
make "${{ matrix.tests }}" TESTARGS='${{ github.event.inputs.testargs }}'
- name: Turn off /clean up
run: |
ddev poweroff
colima stop
- name: Clean up Homebrew
continue-on-error: true
run: |
brew update
brew autoremove
brew cleanup