forked from ddev/ddev
127 lines (111 loc) · 3.66 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
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"'
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 }}
permissions:
contents: read
jobs:
tests:
name: colima-${{ matrix.tests }}-no-bind-mounts=${{ matrix.no-bind-mounts }}
defaults:
run:
shell: bash
strategy:
matrix:
webserver: [nginx-fpm]
tests: [ test ]
os: [ macos-11 ]
no-bind-mounts: ['false']
fail-fast: false
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@v3
- name: Homebrew cache/restore
uses: actions/cache@v3
env:
cache-name: cache-homebrew-cache-4
with:
path: ~/Library/Caches/Homebrew
key: ${{ runner.os }}-build-${{ env.cache-name }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}
- name: Lima cache/restore
uses: actions/cache@v3
env:
cache-name: cache-lima-4
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.lima
key: ${{ runner.os }}-build-${{ env.cache-name }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}
- 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' && github.event.inputs.debug_enabled }}
- name: Install Colima and deps (macOS)
if: matrix.os == 'macos-11'
run: ./.github/workflows/macos-colima-setup.sh && colima version
- 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 --create-docroot
ddev debug download-images
ddev poweroff
# 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 && docker-compose version && go 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: Store test results
uses: actions/upload-artifact@v3
with:
name: ddev-test-results-${{ matrix.webserver }}
path: /tmp/testresults/