Skip to content

Commit

Permalink
Feat/action linter (#10466)
Browse files Browse the repository at this point in the history
Co-authored-by: Jenny Shu <28537278+jenshu@users.noreply.github.com>
  • Loading branch information
nfuden and jenshu authored Jan 16, 2025
1 parent f748395 commit 1efb9c4
Show file tree
Hide file tree
Showing 16 changed files with 90 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ runs:
using: "composite"
steps:
- name: Prep Go Runner
uses: ./.github/workflows/composite-actions/prep-go-runner
uses: ./.github/actions/prep-go-runner
- name: Install kind
uses: helm/kind-action@v1.10.0
with:
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ runs:
using: "composite"
steps:
- name: Prep Go Runner
uses: ./.github/workflows/composite-actions/prep-go-runner
uses: ./.github/actions/prep-go-runner
- name: Install kind
uses: helm/kind-action@v1.10.0
with:
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/action_lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: pr-github-workflow-lint

on:
pull_request:
paths:
- .github/*.yaml
- .github/*.yml
permissions:
contents: read

jobs:
actionlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: .github
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- run: go install github.com/rhysd/actionlint/cmd/actionlint@v1.7.6
- run: actionlint
2 changes: 1 addition & 1 deletion .github/workflows/cache-setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ jobs:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Prep Go Runner
uses: ./.github/workflows/composite-actions/prep-go-runner
uses: ./.github/actions/prep-go-runner
2 changes: 1 addition & 1 deletion .github/workflows/conformance-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
uses: actions/checkout@v4

- name: Run Conformance Tests
uses: ./.github/workflows/composite-actions/kube-gateway-api-conformance-tests
uses: ./.github/actions/kube-gateway-api-conformance-tests

# TODO(tim): Add support for downloading the test results and creating
# a pull request whenever a new release > 1.17+ is cut.
60 changes: 30 additions & 30 deletions .github/workflows/nightly-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ jobs:
path: ${{ matrix.version-files.file }}
log-variables: true
- name: Prep Go Runner
uses: ./.github/workflows/composite-actions/prep-go-runner
uses: ./.github/actions/prep-go-runner
# Set up the KinD cluster that the tests will use
- id: setup-kind-cluster
name: Setup KinD Cluster
uses: ./.github/workflows/composite-actions/setup-kind-cluster
uses: ./.github/actions/setup-kind-cluster
with:
cluster-name: ${{ matrix.test.cluster-name }}
kind-node-version: ${{ steps.dotenv.outputs.node_version }}
Expand All @@ -106,7 +106,7 @@ jobs:
# Run the tests
- id: run-tests
name: Run Kubernetes e2e Tests
uses: ./.github/workflows/composite-actions/kubernetes-e2e-tests
uses: ./.github/actions/kubernetes-e2e-tests
with:
cluster-name: ${{ matrix.test.cluster-name }}
test-args: ${{ matrix.test.go-test-args }}
Expand Down Expand Up @@ -152,11 +152,11 @@ jobs:
path: ${{ matrix.version-files.file }}
log-variables: true
- name: Prep Go Runner
uses: ./.github/workflows/composite-actions/prep-go-runner
uses: ./.github/actions/prep-go-runner
# Set up the KinD cluster that the tests will use
- id: setup-kind-cluster
name: Setup KinD Cluster
uses: ./.github/workflows/composite-actions/setup-kind-cluster
uses: ./.github/actions/setup-kind-cluster
with:
cluster-name: ${{ matrix.test.cluster-name }}
kind-node-version: ${{ steps.dotenv.outputs.node_version }}
Expand All @@ -168,7 +168,7 @@ jobs:
# Run the tests
- id: run-tests
name: Run Kubernetes e2e Tests
uses: ./.github/workflows/composite-actions/kubernetes-e2e-tests
uses: ./.github/actions/kubernetes-e2e-tests
with:
cluster-name: ${{ matrix.test.cluster-name }}
test-args: ${{ matrix.test.go-test-args }}
Expand Down Expand Up @@ -215,11 +215,11 @@ jobs:
path: ${{ matrix.version-files.file }}
log-variables: true
- name: Prep Go Runner
uses: ./.github/workflows/composite-actions/prep-go-runner
uses: ./.github/actions/prep-go-runner
# Set up the KinD cluster that the tests will use
- id: setup-kind-cluster
name: Setup KinD Cluster
uses: ./.github/workflows/composite-actions/setup-kind-cluster
uses: ./.github/actions/setup-kind-cluster
with:
cluster-name: ${{ matrix.test.cluster-name }}
kind-node-version: ${{ steps.dotenv.outputs.node_version }}
Expand All @@ -231,7 +231,7 @@ jobs:
# Run the tests
- id: run-tests
name: Run Kubernetes e2e Tests
uses: ./.github/workflows/composite-actions/kubernetes-e2e-tests
uses: ./.github/actions/kubernetes-e2e-tests
with:
cluster-name: ${{ matrix.test.cluster-name }}
test-args: ${{ matrix.test.go-test-args }}
Expand Down Expand Up @@ -277,11 +277,11 @@ jobs:
path: ${{ matrix.version-files.file }}
log-variables: true
- name: Prep Go Runner
uses: ./.github/workflows/composite-actions/prep-go-runner
uses: ./.github/actions/prep-go-runner
# Set up the KinD cluster that the tests will use
- id: setup-kind-cluster
name: Setup KinD Cluster
uses: ./.github/workflows/composite-actions/setup-kind-cluster
uses: ./.github/actions/setup-kind-cluster
with:
cluster-name: ${{ matrix.test.cluster-name }}
kind-node-version: ${{ steps.dotenv.outputs.node_version }}
Expand All @@ -292,7 +292,7 @@ jobs:
# Run the tests
- id: run-tests
name: Run Kubernetes e2e Tests
uses: ./.github/workflows/composite-actions/kubernetes-e2e-tests
uses: ./.github/actions/kubernetes-e2e-tests
with:
cluster-name: ${{ matrix.test.cluster-name }}
test-args: ${{ matrix.test.go-test-args }}
Expand All @@ -317,7 +317,7 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
- uses: ./.github/workflows/composite-actions/regression-tests
- uses: ./.github/actions/regression-tests

regression_tests_main:
name: main regression tests
Expand Down Expand Up @@ -346,7 +346,7 @@ jobs:
- uses: actions/checkout@v4
with:
ref: main
- uses: ./.github/workflows/composite-actions/regression-tests
- uses: ./.github/actions/regression-tests

regression_tests_18:
name: v1.18.x regression tests
Expand Down Expand Up @@ -375,7 +375,7 @@ jobs:
- uses: actions/checkout@v4
with:
ref: v1.18.x
- uses: ./.github/workflows/composite-actions/regression-tests
- uses: ./.github/actions/regression-tests


regression_tests_17:
Expand All @@ -394,7 +394,7 @@ jobs:
- uses: actions/checkout@v4
with:
ref: v1.17.x
- uses: ./.github/workflows/composite-actions/regression-tests
- uses: ./.github/actions/regression-tests

regression_tests_16:
name: v1.16.x regression tests
Expand All @@ -411,7 +411,7 @@ jobs:
- uses: actions/checkout@v4
with:
ref: v1.16.x
- uses: ./.github/workflows/composite-actions/regression-tests
- uses: ./.github/actions/regression-tests

performance_tests_on_demand:
name: on demand performance tests
Expand All @@ -422,8 +422,8 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
- uses: ./.github/workflows/composite-actions/prep-go-runner
- uses: ./.github/workflows/composite-actions/performance-tests
- uses: ./.github/actions/prep-go-runner
- uses: ./.github/actions/performance-tests

performance_tests_main:
name: main performance tests
Expand All @@ -434,8 +434,8 @@ jobs:
- uses: actions/checkout@v4
with:
ref: main
- uses: ./.github/workflows/composite-actions/prep-go-runner
- uses: ./.github/workflows/composite-actions/performance-tests
- uses: ./.github/actions/prep-go-runner
- uses: ./.github/actions/performance-tests

performance_tests_18:
name: v1.18.x performance tests
Expand All @@ -446,8 +446,8 @@ jobs:
- uses: actions/checkout@v4
with:
ref: v1.18.x
- uses: ./.github/workflows/composite-actions/prep-go-runner
- uses: ./.github/workflows/composite-actions/performance-tests
- uses: ./.github/actions/prep-go-runner
- uses: ./.github/actions/performance-tests

performance_tests_17:
name: v1.17.x performance tests
Expand All @@ -458,8 +458,8 @@ jobs:
- uses: actions/checkout@v4
with:
ref: v1.17.x
- uses: ./.github/workflows/composite-actions/prep-go-runner
- uses: ./.github/workflows/composite-actions/performance-tests
- uses: ./.github/actions/prep-go-runner
- uses: ./.github/actions/performance-tests

performance_tests_16:
name: v1.16.x performance tests
Expand All @@ -470,8 +470,8 @@ jobs:
- uses: actions/checkout@v4
with:
ref: v1.16.x
- uses: ./.github/workflows/composite-actions/prep-go-runner
- uses: ./.github/workflows/composite-actions/performance-tests
- uses: ./.github/actions/prep-go-runner
- uses: ./.github/actions/performance-tests

kube_gateway_api_conformance_tests_main:
name: Conformance (branch=main, type=Kubernetes Gateway API, version=${{matrix.kube-version.node}} )
Expand All @@ -489,7 +489,7 @@ jobs:
- uses: actions/checkout@v4
with:
ref: main
- uses: ./.github/workflows/composite-actions/kube-gateway-api-conformance-tests
- uses: ./.github/actions/kube-gateway-api-conformance-tests

kube_gateway_api_conformance_tests_18:
name: Conformance (branch=v1.18.x, type=Kubernetes Gateway API, version=${{matrix.kube-version.node}} )
Expand All @@ -507,7 +507,7 @@ jobs:
- uses: actions/checkout@v4
with:
ref: v1.18.x
- uses: ./.github/workflows/composite-actions/kube-gateway-api-conformance-tests
- uses: ./.github/actions/kube-gateway-api-conformance-tests


kube_gateway_api_conformance_tests_17:
Expand All @@ -526,7 +526,7 @@ jobs:
- uses: actions/checkout@v4
with:
ref: v1.17.x
- uses: ./.github/workflows/composite-actions/kube-gateway-api-conformance-tests
- uses: ./.github/actions/kube-gateway-api-conformance-tests

publish_results:
runs-on: ubuntu-22.04
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# # which compares the state of two branches
# fetch-depth: 0
# - id: process-skip-directives
# uses: ./.github/workflows/composite-actions/process-skip-directives
# uses: ./.github/actions/process-skip-directives
# with:
# base-ref: ${{ github.base_ref }}
# - id: run-strategy
Expand Down Expand Up @@ -101,7 +101,7 @@
# echo "Regression tests auto-succeeded"
# - uses: actions/checkout@v4
# - name: Prep Go Runner
# uses: ./.github/workflows/composite-actions/prep-go-runner
# uses: ./.github/actions/prep-go-runner
# if: needs.prepare_env.outputs.should-auto-succeed-kube-tests != 'true'
# # The dotenv action is used to load key-value pairs from files.
# # In this case, the file is specified in the matrix and will contain the versions of the tools to use
Expand All @@ -115,7 +115,7 @@
# - id: setup-kind-cluster
# name: Setup KinD Cluster
# if: needs.prepare_env.outputs.should-auto-succeed-kube-tests != 'true'
# uses: ./.github/workflows/composite-actions/setup-kind-cluster
# uses: ./.github/actions/setup-kind-cluster
# with:
# cluster-name: ${{ matrix.test.cluster-name }}
# kind-node-version: ${{ steps.dotenv.outputs.node_version }}
Expand All @@ -125,7 +125,7 @@
# istio-version: ${{ steps.dotenv.outputs.istio_version }}
# - id: run-tests
# if: needs.prepare_env.outputs.should-auto-succeed-kube-tests != 'true'
# uses: ./.github/workflows/composite-actions/kubernetes-e2e-tests
# uses: ./.github/actions/kubernetes-e2e-tests
# with:
# cluster-name: ${{ matrix.test.cluster-name }}
# test-args: ${{ matrix.test.go-test-args }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/regression-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
# which compares the state of two branches
fetch-depth: 0
- id: process-skip-directives
uses: ./.github/workflows/composite-actions/process-skip-directives
uses: ./.github/actions/process-skip-directives
with:
base-ref: ${{ github.base_ref }}
- id: run-strategy
Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:
# - uses: actions/checkout@v4
# - id: run-tests
# if: needs.prepare_env.outputs.should-auto-succeed-regression-tests != 'true'
# uses: ./.github/workflows/composite-actions/regression-tests
# uses: ./.github/actions/regression-tests
# - id: auto-succeed-tests
# if: needs.prepare_env.outputs.should-auto-succeed-regression-tests == 'true'
# run: |
Expand Down Expand Up @@ -92,4 +92,4 @@ jobs:
echo "Kubernetes Gateway API conformance tests auto-succeeded"
- id: run-tests
if: needs.prepare_env.outputs.should-auto-succeed-regression-tests != 'true'
uses: ./.github/workflows/composite-actions/kube-gateway-api-conformance-tests
uses: ./.github/actions/kube-gateway-api-conformance-tests
4 changes: 2 additions & 2 deletions .github/workflows/static-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Prep Go Runner
uses: ./.github/workflows/composite-actions/prep-go-runner
uses: ./.github/actions/prep-go-runner
- name: Generate Code
run: |
./ci/check-generated-code.sh
Expand All @@ -34,7 +34,7 @@ jobs:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Prep Go Runner
uses: ./.github/workflows/composite-actions/prep-go-runner
uses: ./.github/actions/prep-go-runner
- uses: golangci/golangci-lint-action@v6
# `make analyze` runs the linter with similar arguments to what we use here.
# If this action fails, try running `make analyze` locally.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/trivy-analysis-scheduled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
sudo dpkg -i trivy_${TRIVY_VERSION}_Linux-64bit.deb
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- uses: ./.github/workflows/composite-actions/prep-go-runner
- uses: ./.github/actions/prep-go-runner
- name: Setup - gcloud / gsutil
uses: 'google-github-actions/auth@v2'
with:
Expand Down
Loading

0 comments on commit 1efb9c4

Please sign in to comment.