Skip to content

Commit

Permalink
Workflow updates, validate examples
Browse files Browse the repository at this point in the history
  • Loading branch information
manicminer committed Jan 31, 2023
1 parent 66c01cc commit ce31587
Show file tree
Hide file tree
Showing 15 changed files with 235 additions and 45 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/golint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
- uses: actions/setup-go@v3
with:
go-version-file: .go-version
- uses: golangci/golangci-lint-action@v2
- uses: golangci/golangci-lint-action@v3
with:
version: 'v1.49.0'
version: 'v1.50.1'
args: -v
19 changes: 19 additions & 0 deletions .github/workflows/issue-comment-created.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
---
name: Issue Comment Created Triage

on:
issue_comment:
types: [created]

permissions:
pull-requests: write
issues: write

jobs:
issue_comment_triage:
runs-on: ubuntu-latest
Expand All @@ -13,6 +18,20 @@ jobs:
github_token: "${{ secrets.GITHUB_TOKEN }}"
labels: stale
- uses: actions-ecosystem/action-remove-labels@v1
if: ${{ !github.event.issue.pull_request }}
with:
github_token: "${{ secrets.GITHUB_TOKEN }}"
labels: waiting-response
- uses: actions-ecosystem/action-remove-labels@v1
if: (github.event.issue.pull_request && github.actor == github.event.issue.user.login)
with:
github_token: "${{ secrets.GITHUB_TOKEN }}"
labels: waiting-response

pull_request_comment:
runs-on: ubuntu-latest
if: github.event.issue.pull_request && endsWith(github.event.comment.body, '/wr')
steps:
- shell: bash
run: |
curl -X POST -H "Accept: application/vnd.github+json" -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/repos${{ github.owner }}/${{ github.repository }}/issues/${{ github.event.issue.number }}/labels" -d '{"labels":["waiting-response"]}'
16 changes: 10 additions & 6 deletions .github/workflows/issue-opened.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
---
name: Issue Opened Triage

permissions:
issues: write

on:
issues:
types: [opened]
Expand All @@ -8,9 +12,9 @@ jobs:
issue_triage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: github/[email protected]
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: .github/labeler-issue-triage.yml
enable-versioned-regex: 0
- uses: actions/checkout@v3
- uses: github/[email protected]
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: .github/labeler-issue-triage.yml
enable-versioned-regex: 0
27 changes: 27 additions & 0 deletions .github/workflows/link-milestone.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: Link Milestone

on:
pull_request_target:
branches: [main]
types: ['closed']

jobs:
link-milestone:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
issues: write
steps:
- uses: actions/setup-go@v3
with:
go-version-file: .go-version
- run: |
go install github.com/stephybun/link-milestone@latest
link-milestone
env:
PR_NUMBER: ${{ github.event.number }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPO: ${{ github.repository }}
1 change: 1 addition & 0 deletions .github/workflows/lock.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: 'Lock Threads'

on:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/milestone-closed.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: Closed Milestones

on:
Expand Down
40 changes: 22 additions & 18 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,30 @@
---
name: "Pull Request Triage"

permissions:
pull-requests: write
issues: write

on: [pull_request_target]

jobs:
triage:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v3
with:
configuration-path: .github/labeler-pull-request-triage.yml
repo-token: "${{ secrets.GITHUB_TOKEN }}"
# See also: https://github.com/CodelyTV/pr-size-labeler/pull/26
- uses: CodelyTV/pr-size-labeler@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
xs_label: 'size/XS'
xs_max_size: '30'
s_label: 'size/S'
s_max_size: '60'
m_label: 'size/M'
m_max_size: '150'
l_label: 'size/L'
l_max_size: '300'
xl_label: 'size/XL'
message_if_xl: ''
- uses: actions/labeler@v3
with:
configuration-path: .github/labeler-pull-request-triage.yml
repo-token: "${{ secrets.GITHUB_TOKEN }}"
- uses: CodelyTV/pr-size-labeler@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
xs_label: 'size/XS'
xs_max_size: '30'
s_label: 'size/S'
s_max_size: '60'
m_label: 'size/M'
m_max_size: '150'
l_label: 'size/L'
l_max_size: '300'
xl_label: 'size/XL'
message_if_xl: ''
16 changes: 3 additions & 13 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: Release

on:
Expand All @@ -9,16 +10,6 @@ permissions:
contents: write

jobs:
go-version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.go-version.outputs.version }}
steps:
- uses: actions/checkout@v2

- id: go-version
run: echo "::set-output name=version::$(cat ./.go-version)"

release-notes:
runs-on: ubuntu-latest
steps:
Expand All @@ -37,7 +28,7 @@ jobs:

terraform-provider-release:
name: 'Terraform Provider Release'
needs: [go-version, release-notes]
needs: release-notes
uses: hashicorp/ghaction-terraform-provider-release/.github/workflows/hashicorp.yml@v2
secrets:
hc-releases-github-token: '${{ secrets.HASHI_RELEASES_GITHUB_TOKEN }}'
Expand All @@ -51,6 +42,5 @@ jobs:
signore-client-secret: '${{ secrets.SIGNORE_CLIENT_SECRET }}'
with:
release-notes: true
setup-go-version: '${{ needs.go-version.outputs.version }}'
# Product Version (e.g. v1.2.3 or github.ref_name)
setup-go-version-file: .go-version
product-version: '${{ github.ref_name }}'
10 changes: 9 additions & 1 deletion .github/workflows/teamcity-test.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
---
name: TeamCity Config Test

permissions:
contents: read

on:
pull_request:
types: ['opened', 'synchronize']
Expand All @@ -9,6 +13,10 @@ on:
- '!.teamcity/target/**'
- '.teamcity/**'

concurrency:
group: 'tctest-${{ github.head_ref }}'
cancel-in-progress: true

jobs:
teamcity-test:
runs-on: ubuntu-latest
Expand All @@ -19,7 +27,7 @@ jobs:
distribution: zulu
java-version: 11
java-package: jdk
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/tflint.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
---
name: Terraform Schema Linting

permissions:
contents: read

on:
pull_request:
types: ['opened', 'synchronize']
Expand All @@ -8,6 +12,10 @@ on:
- 'vendor/**'
- '**.go'

concurrency:
group: 'tflint-${{ github.head_ref }}'
cancel-in-progress: true

jobs:
tflint:
runs-on: ubuntu-latest
Expand All @@ -16,7 +24,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version-file: .go-version
go-version-file: ./.go-version
- run: bash scripts/gogetcookie.sh
- run: make tools
- run: make tflint
12 changes: 10 additions & 2 deletions .github/workflows/thirty-two-bit.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
---
name: 32 Bit Build

permissions:
contents: read
pull-requests: read

on:
pull_request:
types: ['opened', 'synchronize']
Expand All @@ -8,14 +13,17 @@ on:
- 'vendor/**'
- '**.go'

concurrency:
group: 'thirtytwo-${{ github.head_ref }}'
cancel-in-progress: true

jobs:
compatibility-32bit-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version-file: .go-version
go-version-file: ./.go-version
- run: bash scripts/gogetcookie.sh
- run: make tools
- run: GOARCH=386 GOOS=linux go build -o 32bitbuild .
15 changes: 13 additions & 2 deletions .github/workflows/unit-test.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
---
name: Unit Tests

permissions:
contents: read
pull-requests: read

on:
pull_request:
types: ['opened', 'synchronize']
Expand All @@ -8,13 +13,19 @@ on:
- 'vendor/**'
- '**.go'

concurrency:
group: 'unit-${{ github.head_ref }}'
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest
runs-on: [custom, linux, large]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version-file: .go-version
go-version-file: ./.go-version
- run: bash scripts/gogetcookie.sh
- run: make test
env:
GITHUB_ACTIONS_STAGE: "UNIT_TESTS"
29 changes: 29 additions & 0 deletions .github/workflows/validate-examples.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
name: Validate Examples

permissions:
contents: read
pull-requests: read

on:
pull_request:
types: ['opened', 'synchronize']
paths:
- '.github/workflows/validate-examples.yaml'
- 'examples/**'

concurrency:
group: 'examples-${{ github.head_ref }}'
cancel-in-progress: true

jobs:
website-lint:
runs-on: [custom, linux, large]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version-file: ./.go-version
- run: bash scripts/gogetcookie.sh
- run: make tools
- run: make validate-examples
3 changes: 3 additions & 0 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,7 @@ teamcity-test:
@$(MAKE) -C .teamcity tools
@$(MAKE) -C .teamcity test

validate-examples:
./scripts/validate-examples.sh

.PHONY: build test testacc vet fmt fmtcheck errcheck vendor-status test-compile
Loading

0 comments on commit ce31587

Please sign in to comment.