Skip to content

Commit

Permalink
Refactor CI pipeline
Browse files Browse the repository at this point in the history
- Split tests to callable workflow to enable multi-release scheduled builds
- Automatic cancel of in-progress pull request builds on a new push

Signed-off-by: Mark S. Lewis <[email protected]>
  • Loading branch information
bestbeforetoday committed Jan 12, 2023
1 parent e2ab2bc commit c6d05c0
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 8 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Pull request

on:
pull_request:
branches:
- release-2.2

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build:
uses: ./.github/workflows/test.yml
10 changes: 10 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Push

on:
push:
branches:
- release-2.2

jobs:
build:
uses: ./.github/workflows/test.yml
20 changes: 13 additions & 7 deletions .github/workflows/build.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
name: Build

on:
push:
branches:
- release-2.2
pull_request:
branches:
- release-2.2
workflow_call:
inputs:
fabric-version:
default: '2.2'
required: false
type: string
checkout-ref:
default: ''
required: false
type: string

env:
FABRIC_VERSION: "2.2"
FABRIC_VERSION: ${{ inputs.fabric-version }}
GOPATH: ${{ github.workspace }}/src/test/fixture

jobs:
Expand All @@ -24,6 +28,8 @@ jobs:
- "17"
steps:
- uses: actions/checkout@v3
with:
ref: ${{ inputs.checkout-ref }}
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion scripts/pull-fabric-images.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash -e
set -euo pipefail

# FABRIC_VERSION is set in .github/workflows/build.yml
# FABRIC_VERSION is set overridden by CI pipeline
VERSION=${FABRIC_VERSION:-2.2}
STABLE_TAG=amd64-${VERSION}-stable

Expand Down

0 comments on commit c6d05c0

Please sign in to comment.