Streamline workflow step seperation (#2222)
* streamline workflow step separation * doh! Co-authored-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
This commit is contained in:
parent
5966623b1a
commit
f2c4712c4f
|
@ -9,28 +9,26 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
steps:
|
steps:
|
||||||
-
|
- name: Delete old contributors-update branch
|
||||||
name: Delete old contributors-update branch
|
|
||||||
uses: dawidd6/action-delete-branch@v3
|
uses: dawidd6/action-delete-branch@v3
|
||||||
with:
|
with:
|
||||||
github_token: ${{secrets.GITHUB_TOKEN}}
|
github_token: ${{secrets.GITHUB_TOKEN}}
|
||||||
branches: contributors-update
|
branches: contributors-update
|
||||||
|
|
||||||
add-contributors:
|
add-contributors:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: delete-old-branch
|
needs: delete-old-branch
|
||||||
steps:
|
steps:
|
||||||
-
|
- uses: actions/checkout@v2
|
||||||
uses: actions/checkout@v2
|
|
||||||
-
|
- name: Create contributors-update branch
|
||||||
name: Create contributors-update branch
|
|
||||||
uses: peterjgrainger/action-create-branch@v2.0.1
|
uses: peterjgrainger/action-create-branch@v2.0.1
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
branch: 'contributors-update'
|
branch: 'contributors-update'
|
||||||
-
|
|
||||||
name: Auto-add contributors
|
- name: Auto-add contributors
|
||||||
uses: BobAnkh/add-contributors@v0.2.2
|
uses: BobAnkh/add-contributors@v0.2.2
|
||||||
with:
|
with:
|
||||||
BRANCH: 'contributors-update'
|
BRANCH: 'contributors-update'
|
||||||
|
|
|
@ -5,7 +5,7 @@ on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
paths:
|
paths:
|
||||||
- 'target/**'
|
- 'target/**'
|
||||||
- '.dockerignore'
|
- '.dockerignore'
|
||||||
- '.gitmodules'
|
- '.gitmodules'
|
||||||
|
@ -22,9 +22,11 @@ jobs:
|
||||||
uses: actions/checkout@v2.3.4
|
uses: actions/checkout@v2.3.4
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v1.6.0
|
uses: docker/setup-buildx-action@v1.6.0
|
||||||
id: buildx
|
id: buildx
|
||||||
|
|
||||||
- name: Cache Docker layers
|
- name: Cache Docker layers
|
||||||
uses: actions/cache@v2.1.6
|
uses: actions/cache@v2.1.6
|
||||||
with:
|
with:
|
||||||
|
@ -32,6 +34,7 @@ jobs:
|
||||||
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-buildx-
|
${{ runner.os }}-buildx-
|
||||||
|
|
||||||
- name: Build image locally
|
- name: Build image locally
|
||||||
uses: docker/build-push-action@v2.7.0
|
uses: docker/build-push-action@v2.7.0
|
||||||
with:
|
with:
|
||||||
|
@ -45,6 +48,7 @@ jobs:
|
||||||
load: true
|
load: true
|
||||||
tags: mailserver-testing:ci
|
tags: mailserver-testing:ci
|
||||||
cache-to: type=local,dest=/tmp/.buildx-cache
|
cache-to: type=local,dest=/tmp/.buildx-cache
|
||||||
|
|
||||||
- name: Run test suite
|
- name: Run test suite
|
||||||
run: >
|
run: >
|
||||||
NAME=mailserver-testing:ci
|
NAME=mailserver-testing:ci
|
||||||
|
@ -56,10 +60,12 @@ jobs:
|
||||||
needs: build-and-test-image
|
needs: build-and-test-image
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2.3.4
|
uses: actions/checkout@v2.3.4
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
- name: Prepare tags
|
- name: Prepare tags
|
||||||
id: prep
|
id: prep
|
||||||
uses: docker/metadata-action@v3.5.0
|
uses: docker/metadata-action@v3.5.0
|
||||||
|
@ -74,11 +80,14 @@ jobs:
|
||||||
type=semver,pattern={{major}}.{{minor}}.{{patch}}
|
type=semver,pattern={{major}}.{{minor}}.{{patch}}
|
||||||
flavor: |
|
flavor: |
|
||||||
latest=auto
|
latest=auto
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v1.2.0
|
uses: docker/setup-qemu-action@v1.2.0
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v1.6.0
|
uses: docker/setup-buildx-action@v1.6.0
|
||||||
id: buildx
|
id: buildx
|
||||||
|
|
||||||
- name: Cache Docker layers
|
- name: Cache Docker layers
|
||||||
uses: actions/cache@v2.1.6
|
uses: actions/cache@v2.1.6
|
||||||
with:
|
with:
|
||||||
|
@ -86,17 +95,20 @@ jobs:
|
||||||
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-buildx-
|
${{ runner.os }}-buildx-
|
||||||
|
|
||||||
- name: Login to DockerHub
|
- name: Login to DockerHub
|
||||||
uses: docker/login-action@v1.10.0
|
uses: docker/login-action@v1.10.0
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
|
||||||
- name: Login to GitHub Container Registry
|
- name: Login to GitHub Container Registry
|
||||||
uses: docker/login-action@v1.10.0
|
uses: docker/login-action@v1.10.0
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Build images locally
|
- name: Build images locally
|
||||||
uses: docker/build-push-action@v2.7.0
|
uses: docker/build-push-action@v2.7.0
|
||||||
with:
|
with:
|
||||||
|
|
|
@ -20,16 +20,19 @@ jobs:
|
||||||
uses: actions/checkout@v2.3.4
|
uses: actions/checkout@v2.3.4
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
- name: Hadolint
|
- name: Hadolint
|
||||||
run: |
|
run: |
|
||||||
make hadolint
|
make hadolint
|
||||||
env:
|
env:
|
||||||
HADOLINT_VERSION: 2.4.1
|
HADOLINT_VERSION: 2.4.1
|
||||||
|
|
||||||
- name: ShellCheck
|
- name: ShellCheck
|
||||||
run: |
|
run: |
|
||||||
make shellcheck
|
make shellcheck
|
||||||
env:
|
env:
|
||||||
SHELLCHECK_VERSION: 0.7.2
|
SHELLCHECK_VERSION: 0.7.2
|
||||||
|
|
||||||
- name: ECLint
|
- name: ECLint
|
||||||
run: |
|
run: |
|
||||||
make eclint
|
make eclint
|
||||||
|
|
|
@ -12,6 +12,7 @@ jobs:
|
||||||
uses: actions/checkout@v2.3.4
|
uses: actions/checkout@v2.3.4
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
- name: Prepare tags
|
- name: Prepare tags
|
||||||
id: prep
|
id: prep
|
||||||
uses: docker/metadata-action@v3.5.0
|
uses: docker/metadata-action@v3.5.0
|
||||||
|
@ -21,22 +22,27 @@ jobs:
|
||||||
${{ secrets.GHCR_REPOSITORY }}
|
${{ secrets.GHCR_REPOSITORY }}
|
||||||
tags: |
|
tags: |
|
||||||
type=raw,value=edge
|
type=raw,value=edge
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v1.2.0
|
uses: docker/setup-qemu-action@v1.2.0
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v1.6.0
|
uses: docker/setup-buildx-action@v1.6.0
|
||||||
id: buildx
|
id: buildx
|
||||||
|
|
||||||
- name: Login to DockerHub
|
- name: Login to DockerHub
|
||||||
uses: docker/login-action@v1.10.0
|
uses: docker/login-action@v1.10.0
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
|
||||||
- name: Login to GitHub Container Registry
|
- name: Login to GitHub Container Registry
|
||||||
uses: docker/login-action@v1.10.0
|
uses: docker/login-action@v1.10.0
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Build image locally
|
- name: Build image locally
|
||||||
uses: docker/build-push-action@v2.7.0
|
uses: docker/build-push-action@v2.7.0
|
||||||
with:
|
with:
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
name: "Test Merge Requests"
|
name: "Test Merge Requests"
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- 'target/**'
|
- 'target/**'
|
||||||
- 'test/**'
|
- 'test/**'
|
||||||
- '.dockerignore'
|
- '.dockerignore'
|
||||||
|
@ -19,11 +19,14 @@ jobs:
|
||||||
uses: actions/checkout@v2.3.4
|
uses: actions/checkout@v2.3.4
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v1.2.0
|
uses: docker/setup-qemu-action@v1.2.0
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v1.6.0
|
uses: docker/setup-buildx-action@v1.6.0
|
||||||
id: buildx
|
id: buildx
|
||||||
|
|
||||||
- name: Cache Docker layers
|
- name: Cache Docker layers
|
||||||
uses: actions/cache@v2.1.6
|
uses: actions/cache@v2.1.6
|
||||||
with:
|
with:
|
||||||
|
@ -31,6 +34,7 @@ jobs:
|
||||||
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-buildx-
|
${{ runner.os }}-buildx-
|
||||||
|
|
||||||
- name: Build images locally
|
- name: Build images locally
|
||||||
uses: docker/build-push-action@v2.7.0
|
uses: docker/build-push-action@v2.7.0
|
||||||
with:
|
with:
|
||||||
|
@ -43,6 +47,7 @@ jobs:
|
||||||
platforms: linux/amd64,linux/arm/v7,linux/arm64
|
platforms: linux/amd64,linux/arm/v7,linux/arm64
|
||||||
tags: mailserver-testing:ci
|
tags: mailserver-testing:ci
|
||||||
cache-to: type=local,dest=/tmp/.buildx-cache
|
cache-to: type=local,dest=/tmp/.buildx-cache
|
||||||
|
|
||||||
- name: Build image for test suit
|
- name: Build image for test suit
|
||||||
uses: docker/build-push-action@v2.7.0
|
uses: docker/build-push-action@v2.7.0
|
||||||
with:
|
with:
|
||||||
|
@ -56,9 +61,10 @@ jobs:
|
||||||
load: true
|
load: true
|
||||||
tags: mailserver-testing:ci
|
tags: mailserver-testing:ci
|
||||||
cache-from: type=local,src=/tmp/.buildx-cache
|
cache-from: type=local,src=/tmp/.buildx-cache
|
||||||
|
|
||||||
- name: Run test suite
|
- name: Run test suite
|
||||||
run: >
|
run: >
|
||||||
NAME=mailserver-testing:ci
|
NAME=mailserver-testing:ci
|
||||||
bash -c 'make generate-accounts tests'
|
bash -c 'make generate-accounts tests'
|
||||||
env:
|
env:
|
||||||
CI: true
|
CI: true
|
||||||
|
|
Loading…
Reference in New Issue