fixes the PR testing problems

This commit is contained in:
Georg Lauterbach 2021-01-16 15:34:31 +01:00
parent 614fbb4983
commit c31a62d2f6
No known key found for this signature in database
GPG key ID: 2FDC58699AF121C6
6 changed files with 30 additions and 49 deletions

View file

@ -6,7 +6,7 @@ on:
jobs: jobs:
stale: stale:
runs-on: ubuntu-latest runs-on: ubuntu-20.04
steps: steps:
- uses: actions/stale@v3 - uses: actions/stale@v3
with: with:

View file

@ -6,7 +6,7 @@ on:
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-20.04
outputs: outputs:
imagetag: ${{ steps.prep.outputs.imagetag }} imagetag: ${{ steps.prep.outputs.imagetag }}
steps: steps:
@ -54,7 +54,7 @@ jobs:
test: test:
needs: build needs: build
runs-on: ubuntu-latest runs-on: ubuntu-20.04
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
@ -68,7 +68,7 @@ jobs:
publish: publish:
needs: test needs: test
runs-on: ubuntu-latest runs-on: ubuntu-20.04
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2

View file

@ -8,7 +8,7 @@ on:
jobs: jobs:
lint: lint:
runs-on: ubuntu-latest runs-on: ubuntu-20.04
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2

View file

@ -6,7 +6,7 @@ on:
jobs: jobs:
publish: publish:
runs-on: ubuntu-latest runs-on: ubuntu-20.04
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2

View file

@ -1,59 +1,40 @@
name: "Test Merge Requests" name: "Test Merge Requests"
on: on: pull_request
pull_request:
branches: [ "*" ]
jobs: jobs:
build: build-and-test:
runs-on: ubuntu-latest runs-on: ubuntu-20.04
outputs:
imagetag: ${{ steps.prep.outputs.imagetag }}
steps: steps:
- name: Checkout -
name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
with: with:
submodules: recursive submodules: recursive
- name: Prepare -
id: prep name: Set up QEMU
run: |
DOCKER_IMAGE=docker.io/mailserver/testing
TAGS="${DOCKER_IMAGE}:${GITHUB_SHA::8},${DOCKER_IMAGE}:latest"
echo ::set-output name=tags::${TAGS}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1 uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx -
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1 uses: docker/setup-buildx-action@v1
id: buildx id: buildx
- name: Login to DockerHub -
uses: docker/login-action@v1 name: Build image locally
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build image locally
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
with: with:
builder: ${{ steps.buildx.outputs.name }} builder: ${{ steps.buildx.outputs.name }}
context: .
file: ./Dockerfile
build-args: | build-args: |
VCS_REF=${{ github.sha }} VCS_REF=${{ github.sha }}
VCS_VER=${{ github.ref }} VCS_VER=${{ github.ref }}
context: .
file: ./Dockerfile
load: true
platforms: linux/amd64 platforms: linux/amd64
pull: true tags: docker.io/mailserver/testing:ci
push: true -
tags: ${{ steps.prep.outputs.tags }} name: Run all tests
run: >
test: NAME=docker.io/mailserver/testing:ci
needs: build bash -c 'make generate-accounts tests'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
- name: run test suite
run: |
NAME=docker.io/mailserver/testing:${GITHUB_SHA::8} bash -c 'make generate-accounts tests'
env: env:
CI: true CI: true

View file

@ -66,10 +66,10 @@ A fullstack but simple mail server (SMTP, IMAP, LDAP, Antispam, Antivirus, etc.)
Download the `docker-compose.yml`, `compose.env`, `mailserver.env` and the `setup.sh` files: Download the `docker-compose.yml`, `compose.env`, `mailserver.env` and the `setup.sh` files:
``` BASH ``` BASH
wget https://raw.githubusercontent.com/docker-mailserver/docker-mailserver/stable/setup.sh wget https://raw.githubusercontent.com/docker-mailserver/docker-mailserver/master/setup.sh
wget https://raw.githubusercontent.com/docker-mailserver/docker-mailserver/stable/docker-compose.yml wget https://raw.githubusercontent.com/docker-mailserver/docker-mailserver/master/docker-compose.yml
wget https://raw.githubusercontent.com/docker-mailserver/docker-mailserver/stable/mailserver.env wget https://raw.githubusercontent.com/docker-mailserver/docker-mailserver/master/mailserver.env
wget -O .env https://raw.githubusercontent.com/docker-mailserver/docker-mailserver/stable/compose.env wget -O .env https://raw.githubusercontent.com/docker-mailserver/docker-mailserver/master/compose.env
chmod a+x ./setup.sh chmod a+x ./setup.sh
``` ```