2021-01-16 09:16:05 +00:00
|
|
|
name: "Test Merge Requests"
|
|
|
|
|
2021-02-11 08:48:45 +00:00
|
|
|
on:
|
2021-05-16 18:46:55 +00:00
|
|
|
workflow_dispatch:
|
2021-02-11 08:48:45 +00:00
|
|
|
pull_request:
|
|
|
|
paths:
|
|
|
|
- 'target/**'
|
|
|
|
- 'test/**'
|
|
|
|
- '.dockerignore'
|
|
|
|
- '.gitmodules'
|
|
|
|
- 'Dockerfile'
|
|
|
|
- 'setup.sh'
|
2021-01-16 09:16:05 +00:00
|
|
|
|
|
|
|
jobs:
|
2021-01-16 14:34:31 +00:00
|
|
|
build-and-test:
|
|
|
|
runs-on: ubuntu-20.04
|
2021-01-16 09:16:05 +00:00
|
|
|
steps:
|
2021-01-17 16:41:47 +00:00
|
|
|
- name: Checkout
|
2021-05-12 09:51:46 +00:00
|
|
|
uses: actions/checkout@v2.3.4
|
2021-01-16 09:16:05 +00:00
|
|
|
with:
|
|
|
|
submodules: recursive
|
2021-05-16 16:54:49 +00:00
|
|
|
- name: Set up QEMU
|
2021-05-31 10:40:05 +00:00
|
|
|
uses: docker/setup-qemu-action@v1.2.0
|
2021-05-16 16:54:49 +00:00
|
|
|
- name: Set up Docker Buildx
|
2021-07-05 10:16:03 +00:00
|
|
|
uses: docker/setup-buildx-action@v1.5.0
|
2021-05-16 16:54:49 +00:00
|
|
|
id: buildx
|
2021-05-16 18:46:55 +00:00
|
|
|
- name: Cache Docker layers
|
2021-05-31 10:31:40 +00:00
|
|
|
uses: actions/cache@v2.1.6
|
2021-05-16 18:46:55 +00:00
|
|
|
with:
|
|
|
|
path: /tmp/.buildx-cache
|
|
|
|
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-buildx-
|
|
|
|
- name: Build images locally
|
2021-07-05 10:15:10 +00:00
|
|
|
uses: docker/build-push-action@v2.6.1
|
2021-01-16 09:16:05 +00:00
|
|
|
with:
|
2021-05-16 16:54:49 +00:00
|
|
|
builder: ${{ steps.buildx.outputs.name }}
|
2021-01-17 16:41:47 +00:00
|
|
|
context: .
|
|
|
|
file: ./Dockerfile
|
2021-01-16 09:16:05 +00:00
|
|
|
build-args: |
|
|
|
|
VCS_REF=${{ github.sha }}
|
|
|
|
VCS_VER=${{ github.ref }}
|
2021-05-15 18:36:36 +00:00
|
|
|
platforms: linux/amd64,linux/arm/v7,linux/arm64
|
2021-05-16 18:46:55 +00:00
|
|
|
tags: mailserver-testing:ci
|
|
|
|
cache-to: type=local,dest=/tmp/.buildx-cache
|
|
|
|
- name: Build image for test suit
|
2021-07-05 10:15:10 +00:00
|
|
|
uses: docker/build-push-action@v2.6.1
|
2021-05-16 18:46:55 +00:00
|
|
|
with:
|
|
|
|
builder: ${{ steps.buildx.outputs.name }}
|
|
|
|
context: .
|
|
|
|
file: ./Dockerfile
|
|
|
|
build-args: |
|
|
|
|
VCS_REF=${{ github.sha }}
|
|
|
|
VCS_VER=${{ github.ref }}
|
|
|
|
platforms: linux/amd64
|
2021-01-17 16:41:47 +00:00
|
|
|
load: true
|
|
|
|
tags: mailserver-testing:ci
|
2021-05-16 18:46:55 +00:00
|
|
|
cache-from: type=local,src=/tmp/.buildx-cache
|
2021-01-17 16:41:47 +00:00
|
|
|
- name: Run test suite
|
2021-01-16 14:34:31 +00:00
|
|
|
run: >
|
2021-01-17 16:41:47 +00:00
|
|
|
NAME=mailserver-testing:ci
|
2021-01-16 14:34:31 +00:00
|
|
|
bash -c 'make generate-accounts tests'
|
2021-01-16 09:16:05 +00:00
|
|
|
env:
|
|
|
|
CI: true
|