Skip to content

Commit

Permalink
[DDO-3641] Rework for required checks (#543)
Browse files Browse the repository at this point in the history
  • Loading branch information
jack-r-warren authored May 1, 2024
1 parent fee02b6 commit f0a4b2f
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 61 deletions.
10 changes: 10 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,29 @@ updates:
directory: /
schedule:
interval: weekly
commit-message:
prefix: "[DDO-3654]"
- package-ecosystem: gomod
directory: /go-shared
schedule:
interval: weekly
commit-message:
prefix: "[DDO-3654]"
- package-ecosystem: gomod
directory: /sherlock
schedule:
interval: weekly
commit-message:
prefix: "[DDO-3654]"
- package-ecosystem: gomod
directory: /sherlock-go-client
schedule:
interval: weekly
commit-message:
prefix: "[DDO-3654]"
- package-ecosystem: gomod
directory: /sherlock-webhook-proxy
schedule:
interval: weekly
commit-message:
prefix: "[DDO-3654]"
33 changes: 9 additions & 24 deletions .github/workflows/sherlock-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,6 @@ on:
pull_request:
branches:
- main
paths:
- ".github/workflows/sherlock-build.yaml"
- ".github/workflows/client-report-app-version.yaml"
- ".github/workflows/client-report-workflow.yaml"
- "sherlock/**"
- "!sherlock/docs/**"
- "go-shared/**"
- "!**/*.md"
workflow_dispatch:

env:
Expand Down Expand Up @@ -97,7 +89,6 @@ jobs:
go-version-file: sherlock/go.mod

- name: Set up Node/NPM
if: ${{ github.event_name != 'pull_request' }}
uses: actions/setup-node@v4
with:
node-version: 18
Expand All @@ -118,12 +109,10 @@ jobs:
run: make document-pact-provider

- name: Delete existing Go client library code
if: ${{ github.event_name != 'pull_request' }}
# Just delete code, not config, so that no-longer-generated files will disappear
run: rm -rf sherlock-go-client/client

- name: Generate Go client library
if: ${{ github.event_name != 'pull_request' }}
run: |
docker run --rm -e GOPATH=/go \
-v $(go env GOPATH):/go \
Expand All @@ -133,17 +122,14 @@ jobs:
generate client -f /local/sherlock/docs/swagger.json -A sherlock --default-scheme=https -m client/models -c client
- name: Tidy Go client library dependencies
if: ${{ github.event_name != 'pull_request' }}
working-directory: sherlock-go-client
run: go mod tidy

- name: Delete existing Typescript client library code
if: ${{ github.event_name != 'pull_request' }}
# Just delete code, not config, so that no-longer-generated files will disappear
run: rm -rf sherlock-typescript-client/src

- name: Generate Typescript client library
if: ${{ github.event_name != 'pull_request' }}
run: |
docker run --rm -v "${PWD}:/local" openapitools/openapi-generator-cli generate \
-i /local/sherlock/docs/swagger.json \
Expand All @@ -157,7 +143,6 @@ jobs:
--additional-properties=npmVersion=${{ needs.generate-tag.outputs.tag }}
- name: Build Typescript client
if: ${{ github.event_name != 'pull_request' }}
working-directory: sherlock-typescript-client
run: |
npm install --save-dev
Expand Down Expand Up @@ -196,15 +181,6 @@ jobs:
with:
image: us-central1-docker.pkg.dev/dsp-artifact-registry/sherlock/sherlock:${{ needs.generate-tag.outputs.tag }}

- name: Auth to GCP
id: auth
if: ${{ github.actor != 'dependabot[bot]' }}
uses: google-github-actions/auth@v2
with:
token_format: access_token
workload_identity_provider: projects/1038484894585/locations/global/workloadIdentityPools/github-wi-pool/providers/github-wi-provider
service_account: [email protected]

- name: Commit changes
if: ${{ github.event_name != 'pull_request' }}
run: |
Expand All @@ -224,6 +200,15 @@ jobs:
git tag "go-shared/${{ needs.generate-tag.outputs.tag }}"
git tag "sherlock-go-client/${{ needs.generate-tag.outputs.tag }}"
- name: Auth to GCP
id: auth
if: ${{ github.actor != 'dependabot[bot]' }}
uses: google-github-actions/auth@v2
with:
token_format: access_token
workload_identity_provider: projects/1038484894585/locations/global/workloadIdentityPools/github-wi-pool/providers/github-wi-provider
service_account: [email protected]

- name: Push to main
if: ${{ github.event_name != 'pull_request' }}
run: |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
name: API Diff

on:
pull_request:
branches:
- main
paths:
- ".github/workflows/sherlock-api-diff.yaml"
- "sherlock/**"
- "!sherlock/docs/**"
- "go-shared/**"
- "!**/*.md"

concurrency:
# Don't run this workflow concurrently on the same branch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
# Source repository: https://github.com/actions/dependency-review-action
# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement
name: 'Dependency Review'
on: [pull_request]
on:
pull_request:
branches:
- main

permissions:
contents: read
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,9 @@
name: Lint Sherlock
on:
push:
branches:
- main
paths:
- ".github/workflows/sherlock-lint.yaml"
- "sherlock/**"
- "!sherlock/docs/**"
- "go-shared/**"
- "sherlock-webhook-proxy/**"
- "!**/*.md"
pull_request:
branches:
- main
paths:
- ".github/workflows/sherlock-lint.yaml"
- "sherlock/**"
- "!sherlock/docs/**"
- "go-shared/**"
- "sherlock-webhook-proxy/**"
- "!**/*.md"

jobs:
golangci:
runs-on: ubuntu-latest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,9 @@ on:
push:
branches:
- main
paths:
- ".github/workflows/sherlock-test.yaml"
- "sherlock/**"
- "!sherlock/docs/**"
- "go-shared/**"
- "!**/*.md"
pull_request:
branches:
- main
paths:
- ".github/workflows/sherlock-test.yaml"
- "sherlock/**"
- "!sherlock/docs/**"
- "go-shared/**"
- "!**/*.md"

jobs:
test:
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/sherlock-check-ticket.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: 'Ticket Check'
on:
pull_request:
branches:
- main
jobs:
ticket-present:
runs-on: ubuntu-latest
steps:
- name: 'Ticket Present in PR Title'
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: |
echo "Checking for ticket in PR title..."
if [[ "$PR_TITLE" =~ [A-Z]{2,}-[0-9]+ ]]; then
echo "Ticket found in PR title!"
exit 0
else
echo "No ticket found in PR title!"
exit 1
fi

0 comments on commit f0a4b2f

Please sign in to comment.