2021-01-16 09:16:05 +00:00
|
|
|
name: "Test Merge Requests"
|
|
|
|
|
2021-09-28 10:37:54 +00:00
|
|
|
on:
|
2021-05-16 18:46:55 +00:00
|
|
|
workflow_dispatch:
|
2021-02-11 08:48:45 +00:00
|
|
|
pull_request:
|
2021-09-28 10:37:54 +00:00
|
|
|
paths:
|
2021-02-11 08:48:45 +00:00
|
|
|
- '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
|
2022-03-08 22:57:01 +00:00
|
|
|
uses: actions/checkout@v3
|
2021-01-16 09:16:05 +00:00
|
|
|
with:
|
|
|
|
submodules: recursive
|
2021-09-28 10:37:54 +00:00
|
|
|
|
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-09-28 10:37:54 +00:00
|
|
|
|
2021-05-16 16:54:49 +00:00
|
|
|
- name: Set up Docker Buildx
|
2022-05-02 13:52:19 +00:00
|
|
|
uses: docker/setup-buildx-action@v1.7.0
|
2021-05-16 16:54:49 +00:00
|
|
|
id: buildx
|
2021-09-28 10:37:54 +00:00
|
|
|
|
2021-05-16 18:46:55 +00:00
|
|
|
- name: Cache Docker layers
|
2022-03-21 17:43:58 +00:00
|
|
|
uses: actions/cache@v3
|
2021-05-16 18:46:55 +00:00
|
|
|
with:
|
|
|
|
path: /tmp/.buildx-cache
|
|
|
|
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-buildx-
|
2021-09-28 10:37:54 +00:00
|
|
|
|
2021-05-16 18:46:55 +00:00
|
|
|
- name: Build images locally
|
2022-03-21 14:03:38 +00:00
|
|
|
uses: docker/build-push-action@v2.10.0
|
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
|
2021-09-28 10:37:54 +00:00
|
|
|
|
2021-05-16 18:46:55 +00:00
|
|
|
- name: Build image for test suit
|
2022-03-21 14:03:38 +00:00
|
|
|
uses: docker/build-push-action@v2.10.0
|
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-09-28 10:37:54 +00:00
|
|
|
|
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:
|
2021-09-28 10:37:54 +00:00
|
|
|
CI: true
|