Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
id-ilych committed Oct 30, 2024
2 parents 9ae2e32 + 2511826 commit f02ba27
Show file tree
Hide file tree
Showing 47 changed files with 950 additions and 425 deletions.
26 changes: 26 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-major"]

- package-ecosystem: "bundler"
directory: "/pact_broker"
schedule:
interval: "weekly"
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-major"]

- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "weekly"
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-major"]
26 changes: 26 additions & 0 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Audit

on:
workflow_dispatch:
push:
schedule:
- cron: 0 0 * * 4 # Midnight Wednesday

jobs:
audit:
name: 👮 cross-audit
strategy:
fail-fast: false
matrix:
DOCKER_TARGET_PLATFORM: [linux/arm64, linux/amd64]
runs-on: ubuntu-latest
env:
DOCKER_TARGET_PLATFORM: ${{ matrix.DOCKER_TARGET_PLATFORM }}
TAG: "latest"
steps:
- uses: actions/checkout@v4
- name: Prepare Docker multi-arch builder for ${{ matrix.DOCKER_TARGET_PLATFORM }}
if: ${{ matrix.DOCKER_TARGET_PLATFORM }} == 'linux/arm' || 'linux/arm64'
run: ./script/release-workflow/docker-prepare.sh
- name: Audit Docker image for ${{ matrix.DOCKER_TARGET_PLATFORM }}
run: ./script/release-workflow/audit.sh
19 changes: 0 additions & 19 deletions .github/workflows/docker_test.yml

This file was deleted.

11 changes: 11 additions & 0 deletions .github/workflows/issue-comment-created.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: SmartBear Supported Issue Comment Created

on:
issue_comment:
types:
- created

jobs:
call-workflow:
uses: pact-foundation/.github/.github/workflows/smartbear-issue-comment-created.yml@master
secrets: inherit
50 changes: 46 additions & 4 deletions .github/workflows/release_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,67 @@ on:
repository_dispatch:
types:
- release-triggered
- manual-release-triggered
workflow_dispatch:
# None of these are necessary - an automated release will work out what needs to be incremented
# Can set any of the following:
# increment (will default to minor if not set)
# tag
# increment/version
inputs:
increment:
description: "Custom increment, defaults to minor if not set"
required: false
default: ""
type: choice
options:
- ""
- patch
- minor
- major
- pre
# Sets the first part of the Docker tag - this will update the VERSION file
version:
description: "Custom version, requires increment to be set"
required: false
tag:
description: "Custom Docker image tag (note - this won't update the VERSION file and is for non-prod releases only)"
required: false
push_to_latest:
description: 'Should push to latest'
type: boolean
default: true
docker_repository:
description: The Docker repository to which the image should be published
default: pactfoundation

jobs:
release:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: ruby/setup-ruby@v1
- run: "bundle install"

- name: Log into ghcr registry
if: github.event_name != 'pull_request'
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
ruby-version: 2.6.6
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Release image
run: script/release-workflow/run.sh
env:
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }}
CUSTOM_TAG: ${{ github.event.client_payload.tag }}
DOCKER_REPOSITORY: ${{ github.event.inputs.docker_repository }}
TAG: ${{ github.event.inputs.tag }}
VERSION: ${{ github.event.inputs.version }}
# populate INCREMENT from workflow_dispatch or repository_dispatch
INCREMENT: ${{ github.event.client_payload.increment }}${{ github.event.inputs.increment }}
PUSH_TO_LATEST: ${{ github.event.inputs.push_to_latest }}
11 changes: 11 additions & 0 deletions .github/workflows/smartbear-issue-label-added.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: SmartBear Supported Issue Label Added

on:
issues:
types:
- labeled

jobs:
call-workflow:
uses: pact-foundation/.github/.github/workflows/smartbear-issue-label-added.yml@master
secrets: inherit
30 changes: 17 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,32 @@
name: Test

on: [push, pull_request]
env:
DOCKER_TARGET_PLATFORM: "linux/amd64"
on:
push:
pull_request:
workflow_dispatch:

jobs:
test:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6.6
- run: "bundle install"
- run: "bundle exec rake"

- name: Login to Docker Hub
run: script/release-workflow/docker-login.sh
env:
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Setup Docker builder
run: ./script/release-workflow/docker-prepare.sh

- name: Build Docker image
run: docker buildx build --platform=${DOCKER_TARGET_PLATFORM} -t pactfoundation/pact-broker:latest .
- name: Build Docker image for single platform
run: ./script/release-workflow/docker-build.sh

- uses: KengoTODA/actions-setup-docker-compose@v1
if: ${{ env.ACT }}
name: Install `docker-compose` for use with https://github.com/nektos/act
with:
version: '2.15.1'

- name: Integration tests
run: script/test.sh
env:
TAG: latest-amd64
15 changes: 15 additions & 0 deletions .github/workflows/triage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Triage Issue

on:
issues:
types:
- opened
- labeled
pull_request:
types:
- labeled

jobs:
call-workflow:
uses: pact-foundation/.github/.github/workflows/triage.yml@master
secrets: inherit
14 changes: 6 additions & 8 deletions .github/workflows/trigger_pact_docs_update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@ on:
- '**.md'

jobs:
run:
trigger_docs_update:
runs-on: ubuntu-latest
steps:
- name: Trigger docs.pact.io update workflow
run: |
curl -X POST https://api.github.com/repos/pact-foundation/docs.pact.io/dispatches \
-H 'Accept: application/vnd.github.everest-preview+json' \
-H "Authorization: Bearer $GITHUB_TOKEN" \
-d '{"event_type": "pact-broker-docker-pactfoundation-docs-updated"}'
env:
GITHUB_TOKEN: ${{ secrets.GHTOKENFORTRIGGERINGPACTDOCSUPDATE }}
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.GHTOKENFORTRIGGERINGPACTDOCSUPDATE }}
repository: pact-foundation/docs.pact.io
event-type: pact-broker-docker-pactfoundation-docs-updated
38 changes: 29 additions & 9 deletions .github/workflows/update_gems.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,40 @@ on:
repository_dispatch:
types:
- gem-released
workflow_dispatch:
inputs:
released_gem_name:
description: The name of the gem that was released
default: pact_broker
required: false
released_gem_version:
description: The version of the game that was released
required: false
released_gem_version_increment:
description: "The version increment"
required: false
default: ""
type: choice
options:
- ""
- patch
- minor
- major
- pre

env:
RELEASED_GEM_NAME: '${{ github.event.client_payload.name }}${{ github.event.inputs.released_gem_name }}'
RELEASED_GEM_VERSION: '${{ github.event.client_payload.version }}${{ github.event.inputs.released_gem_version }}'

jobs:
update:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6.4
working-directory: pact_broker

- name: Configure git
Expand All @@ -25,9 +48,6 @@ jobs:
- name: Update gems
run: script/update-gems-workflow/update-gems.sh
env:
RELEASED_GEM_NAME: '${{ github.event.client_payload.name }}'
RELEASED_GEM_VERSION: '${{ github.event.client_payload.version }}'

- name: Detect changes
run: script/update-gems-workflow/detect-changes.sh
Expand All @@ -48,18 +68,18 @@ jobs:

- name: Integration tests
run: script/test.sh
env:
TAG: latest

- name: Git commit and push
run: script/update-gems-workflow/git-commit-and-push-gemfile.sh
env:
RELEASED_GEM_NAME: '${{ github.event.client_payload.name }}'
RELEASED_GEM_VERSION: '${{ github.event.client_payload.version }}'

- name: Vulnerability scan
run: script/scan.sh pactfoundation/pact-broker:latest

- name: Trigger release
uses: peter-evans/repository-dispatch@v1
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.GHTOKENFORPBDOCKERRELEASE }}
event-type: release-triggered
client-payload: '{"increment": "${{ github.event.client_payload.increment }}${{ github.event.inputs.released_gem_version_increment }}"}'
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.3
Loading

0 comments on commit f02ba27

Please sign in to comment.