Skip to content

Commit

Permalink
ci(.github/): update ci configs to match go-fastly and cli (#925)
Browse files Browse the repository at this point in the history
* ci(.github/): update ci configs to match go-fastly and cli
  • Loading branch information
anthony-gomez-fastly authored Feb 13, 2025
1 parent 7b9105e commit 6700d2a
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 40 deletions.
24 changes: 24 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
All Submissions:

* [ ] Have you followed the guidelines in our Contributing document?
* [ ] Have you checked to ensure there aren't other open [Pull Requests](https://github.com/fastly/go-fastly/pulls) for the same update/change?

<!-- You can erase any parts of this template not applicable to your Pull Request. -->

### New Feature Submissions:

* [ ] Does your submission pass tests?

### Changes to Core Features:

* [ ] Have you added an explanation of what your changes do and why you'd like us to include them?
* [ ] Have you written new tests for your core changes, as applicable?
* [ ] Have you successfully run tests with your changes locally?

### User Impact

* [ ] What is the user impact of this change?

### Are there any considerations that need to be addressed for release?

<!-- Any breaking changes, etc -->
23 changes: 23 additions & 0 deletions .github/workflows/dependabot_changelog_update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: 'pull-request'
on:
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
- labeled
- unlabeled
jobs:
changelog:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dangoslen/dependabot-changelog-helper@v3
with:
activationLabels: dependencies
changelogPath: './CHANGELOG.md'
entryPrefix: 'build(deps): '
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "docs(CHANGELOG.md): add dependency bump from dependabot"
44 changes: 4 additions & 40 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,6 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: 1.22.x
- name: Restore cache
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-mod-
- name: Fmt
run: make fmt
- name: Vet
Expand All @@ -39,15 +32,12 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Restore cache
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-mod-
- name: Test
run: make test
changelog:
runs-on: ubuntu-latest
steps:
- uses: dangoslen/changelog-enforcer@v3
docs:
runs-on: ubuntu-latest
steps:
Expand All @@ -65,9 +55,7 @@ jobs:
- name: Check diff
run: |
git diff --exit-code --ignore-all-space ./docs/
# NOTE: The following two `validate-` jobs (and the top-of-file config) are inspired by: https://github.com/imjohnbo/ok-to-test

# Branch-based pull request from owner or trusted developer who has WRITE access.
validate-interface-trusted:
if: "!contains(github.event.pull_request.labels.*.name, 'breaking-change') && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository"
Expand All @@ -79,13 +67,6 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: 1.22.x
- name: Restore cache
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-mod-
- name: Install Terraform CLI
uses: hashicorp/setup-terraform@v3
- name: Validate Interface
Expand All @@ -95,7 +76,6 @@ jobs:
# IMPORTANT: Workflows from forks do not have access to sensitive data such as secrets
# https://bit.ly/gh-actions-fork-secret-access
# We work around this using ./ok-to-test.yml

check-inputs:
runs-on: ubuntu-latest
steps:
Expand All @@ -107,7 +87,6 @@ jobs:
echo 'github.event.client_payload.pull_request.head.sha: ${{ github.event.client_payload.pull_request.head.sha }}'
echo 'github.event.client_payload.slash_command.args.named.sha: ${{ github.event.client_payload.slash_command.args.named.sha }}'
echo 'github.event.client_payload.pull_request.number: ${{ github.event.client_payload.pull_request.number }}'
# Repo owner has commented /ok-to-test on a (fork-based) pull request
# This will run the build not as the forked owner but as your own token user.
validate-interface-fork:
Expand All @@ -129,13 +108,6 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: 1.22.x
- name: Restore cache
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-mod-
- name: Install Terraform CLI
uses: hashicorp/setup-terraform@v3
- name: Validate Interface
Expand Down Expand Up @@ -178,7 +150,6 @@ jobs:
});
return result;
validate-goreleaser:
runs-on: ubuntu-latest
steps:
Expand All @@ -188,13 +159,6 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: 1.22.x
- name: Restore cache
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-mod-
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
Expand Down

0 comments on commit 6700d2a

Please sign in to comment.