build: standardize apt-get usage, remove blackfire from apt sources, … #52
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: "" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
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 |