43 lines
1.1 KiB
YAML
43 lines
1.1 KiB
YAML
name: Moodle Plugin CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- develop
|
|
- main
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
test:
|
|
name: Test (${{ matrix.database }})
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- database: postgresql
|
|
profile: ""
|
|
service: ci
|
|
- database: mysql
|
|
profile: --profile mysql
|
|
service: ci-mysql
|
|
env:
|
|
COMPOSE_PROJECT_NAME: local_webhooks_${{ gitea.run_id }}_${{ gitea.run_attempt }}_${{ matrix.database }}
|
|
steps:
|
|
- name: Check out repository
|
|
uses: https://github.com/actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
|
|
- name: Build test image
|
|
run: docker compose ${{ matrix.profile }} build --pull ${{ matrix.service }}
|
|
|
|
- name: Test plugin
|
|
run: docker compose ${{ matrix.profile }} up --abort-on-container-exit --exit-code-from ${{ matrix.service }} ${{ matrix.service }}
|
|
|
|
- name: Clean up
|
|
if: always()
|
|
run: docker compose ${{ matrix.profile }} down --volumes --remove-orphans --rmi local
|