mirror of
https://github.com/roundcube/roundcubemail-docker.git
synced 2026-02-18 12:51:44 +01:00
52 lines
1.6 KiB
YAML
52 lines
1.6 KiB
YAML
name: Build & Test
|
|
on:
|
|
pull_request: {}
|
|
push:
|
|
branches:
|
|
- '!master'
|
|
jobs:
|
|
build-and-testvariants:
|
|
name: Build image variants and run tests
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
max-parallel: 10
|
|
matrix:
|
|
include:
|
|
- variant: 'apache'
|
|
test-files: 'apache-postgres'
|
|
docker-tag: roundcube/roundcubemail:test-apache
|
|
- variant: 'fpm'
|
|
test-files: 'fpm-postgres'
|
|
docker-tag: roundcube/roundcubemail:test-fpm
|
|
- variant: 'fpm-alpine'
|
|
test-files: 'fpm-postgres'
|
|
docker-tag: roundcube/roundcubemail:test-fpm-alpine
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v3
|
|
- name: Get docker hub username
|
|
id: creds
|
|
run: echo '::set-output name=username::${{ secrets.DOCKER_PULL_USERNAME }}'
|
|
- name: Login to Docker Hub
|
|
if: steps.creds.outputs.username != ''
|
|
uses: docker/login-action@v1
|
|
with:
|
|
username: ${{ secrets.DOCKER_PULL_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PULL_PASSWORD }}
|
|
|
|
- name: Build image for "${{ matrix.variant }}"
|
|
run: cd ${{ matrix.variant }} && docker buildx build ./ -t ${{ matrix.docker-tag }}
|
|
- name: Run tests
|
|
env:
|
|
ROUNDCUBEMAIL_TEST_IMAGE: ${{ matrix.docker-tag }}
|
|
run: |
|
|
set -exu;
|
|
for testFile in ${{ join(matrix.test-files, ' ') }};
|
|
do
|
|
docker-compose -f ./tests/docker-compose.test-${testFile}.yml \
|
|
up --exit-code-from=sut --abort-on-container-exit
|
|
done
|
|
|
|
|