Skip to content

GitHub Actions updates #514

GitHub Actions updates

GitHub Actions updates #514

Workflow file for this run

name: Default
on:
schedule:
- cron: '0 10 * * 0' # Every Sunday at 10AM
push:
branches:
- master
- develop
- feature/*
tags:
- 'v*.*.*'
paths-ignore:
- 'docs/**' # Don't run if there were changes to docs only
workflow_dispatch: # Allow manually triggering a build
defaults:
run:
shell: bash
env:
REPO: docksal/docksal
DOCKSAL_SSH_AGENT_USE_HOST: 0
DOCKSAL_DNS_DISABLED: 1
DOCKSAL_DNS_DOMAIN: docksal.site
jobs:
test:
name: Test
runs-on: ubuntu-22.04
strategy:
fail-fast: false # Don't cancel other jobs if one fails
matrix:
suite:
#- quicktest # Uncomment to run
- project
- config
- db
- system
- commands
- share-v2
#- acquia
#- pantheon
#- platform
#- drush
#- wp
steps:
# Hack to fix docker-gen in Github Actions
# Drops docker daemon config with custom cgroup (which docker-gen does not support)
# See https://github.com/jwilder/docker-gen/issues/315
- name: Fix docker-gen in Github Actions
run: |
sudo rm /etc/docker/daemon.json
sudo service docker restart
-
name: Install BATS (tests)
run: |
git clone https://github.com/bats-core/bats-core.git
cd bats-core
sudo ./install.sh /usr/local
bats -v
-
name: Install SSH key (tests)
env:
SSH_KEY: ${{ env.SSH_KEY }}
run: |
mkdir -p $HOME/.ssh
echo "${SSH_KEY}" | base64 --decode > $HOME/.ssh/project_key
chmod 400 $HOME/.ssh/project_key
-
# Calculate branch for Docksal installation
# Use develop for 3rd-party PRs
name: Calculate branch
id: use_branch
env:
PR_BRANCH: ${{ github.base_ref }}
run: |
USE_BRANCH="$(echo ${GITHUB_REF#refs/heads/})" # Regular branch
if [[ "${GITHUB_REF}" =~ "refs/tags/" ]]; then USE_BRANCH="${GITHUB_REF#refs/tags/}"; fi # Release tag
if [[ "${GITHUB_EVENT_NAME}" == "pull_request" && "${GITHUB_REPOSITORY}" == "${REPO}" ]]; then USE_BRANCH="${PR_BRANCH}"; fi # Internal PR
if [[ "${GITHUB_EVENT_NAME}" == "pull_request" && "${GITHUB_REPOSITORY}" != "${REPO}" ]]; then USE_BRANCH='develop'; fi # External PR
echo "branch=${USE_BRANCH}" >> $GITHUB_OUTPUT
echo "branch=${USE_BRANCH}"
-
name: Install Docksal
env:
DOCKSAL_UPDATE_VERSION: ${{ steps.use_branch.outputs.branch }}
# This installs Docksal using the passed DOCKSAL_UPDATE_VERSION value
run: curl -fsSL https://get.docksal.io | bash
-
name: fin sysinfo
run: fin sysinfo
-
name: Checkout
uses: actions/checkout@v4
-
name: Tests
env:
SUITE: ${{ matrix.suite }}
run: tests/scripts/${SUITE}.sh
# Commenting out at the moment until repos are converted over to GithuB Actions
#-
# if: ${{ matrix.suite }} == "project"
# name: "Execute Boilerplate Tests"
# run: tests/scripts/boilerplates.sh