Run tests #276
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: Run tests | |
on: | |
pull_request: | |
workflow_dispatch: | |
inputs: | |
buildkit-tag: | |
description: "The isle-buildkit tag to pull for the fleet of docker containers" | |
required: true | |
type: string | |
default: 'main' | |
starter-site-owner: | |
description: "The GitHub org the starter site resides in" | |
required: true | |
type: string | |
default: 'Islandora-Devops' | |
starter-site-ref: | |
description: "The islandora-starter-site git ref to checkout (heads/BRANCH-NAME or tags/TAG-NAME)" | |
required: true | |
type: string | |
default: 'heads/main' | |
schedule: | |
- cron: '15 11 * * *' | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-22.04, ubuntu-24.04] | |
env: | |
ISLANDORA_TAG: "${{ github.event.inputs.buildkit-tag }}" | |
ISLANDORA_STARTER_OWNER: "${{ github.event.inputs.starter-site-owner }}" | |
ISLANDORA_STARTER_REF: "${{ github.event.inputs.starter-site-ref }}" | |
steps: | |
- uses: actions/checkout@v4 | |
- run: shellcheck tests/*.sh | |
- name: Install mkcert | |
run: |- | |
curl -JLO "https://dl.filippo.io/mkcert/latest?for=linux/amd64" | |
chmod +x mkcert-v*-linux-amd64 | |
sudo cp mkcert-v*-linux-amd64 /usr/local/bin/mkcert | |
- name: Start islandora-starter-site | |
run: ./tests/init-template-starter.sh | |
- name: Collect logs for each service | |
if: ${{ always() }} | |
run: | | |
mkdir -p logs | |
services=$(docker compose --profile dev config --services) | |
for service in $services; do | |
docker compose --profile dev logs $service > "logs/${service}.log" | |
done | |
docker compose --profile dev exec mariadb-dev mysqldump drupal_default > logs/drupal_default.sql | |
- name: Upload logs as artifacts | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: docker-logs-${{ matrix.os }} | |
path: logs/* | |
- name: Notify Slack on nightly test failure | |
if: failure() && github.event_name == 'schedule' | |
run: |- | |
curl -s -o /dev/null -XPOST $SLACK_WEBHOOK_URL -d '{ | |
"text": "🚨 Scheduled job failed! Click to view the run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}", | |
}' | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |