diff --git a/native-provider-ci/providers/command/repo/.github/workflows/build.yml b/native-provider-ci/providers/command/repo/.github/workflows/build.yml index f9036fe6fb..98639ae35e 100644 --- a/native-provider-ci/providers/command/repo/.github/workflows/build.yml +++ b/native-provider-ci/providers/command/repo/.github/workflows/build.yml @@ -474,6 +474,9 @@ jobs: with: go-version: ${{ env.GOVERSION }} cache-dependency-path: "**/*.sum" + - name: Disarm go:embed directives to enable linters that compile source code + run: git grep -l 'go:embed' -- provider | xargs --no-run-if-empty sed -i + 's/go:embed/ goembed/g' - name: golangci-lint provider pkg uses: golangci/golangci-lint-action@d6238b002a20823d52840fda27e2d4891c5952dc # v4.0.1 with: diff --git a/native-provider-ci/providers/command/repo/.github/workflows/run-acceptance-tests.yml b/native-provider-ci/providers/command/repo/.github/workflows/run-acceptance-tests.yml index 9a67f4595d..624bd01fa0 100644 --- a/native-provider-ci/providers/command/repo/.github/workflows/run-acceptance-tests.yml +++ b/native-provider-ci/providers/command/repo/.github/workflows/run-acceptance-tests.yml @@ -371,6 +371,9 @@ jobs: with: go-version: ${{ env.GOVERSION }} cache-dependency-path: "**/*.sum" + - name: Disarm go:embed directives to enable linters that compile source code + run: git grep -l 'go:embed' -- provider | xargs --no-run-if-empty sed -i + 's/go:embed/ goembed/g' - name: golangci-lint provider pkg uses: golangci/golangci-lint-action@d6238b002a20823d52840fda27e2d4891c5952dc # v4.0.1 with: diff --git a/native-provider-ci/providers/docker-build/repo/.github/workflows/build.yml b/native-provider-ci/providers/docker-build/repo/.github/workflows/build.yml index 372a256a65..8680f4353b 100644 --- a/native-provider-ci/providers/docker-build/repo/.github/workflows/build.yml +++ b/native-provider-ci/providers/docker-build/repo/.github/workflows/build.yml @@ -528,6 +528,9 @@ jobs: with: go-version: ${{ env.GOVERSION }} cache-dependency-path: "**/*.sum" + - name: Disarm go:embed directives to enable linters that compile source code + run: git grep -l 'go:embed' -- provider | xargs --no-run-if-empty sed -i + 's/go:embed/ goembed/g' - name: golangci-lint provider pkg uses: golangci/golangci-lint-action@d6238b002a20823d52840fda27e2d4891c5952dc # v4.0.1 with: diff --git a/native-provider-ci/providers/docker-build/repo/.github/workflows/run-acceptance-tests.yml b/native-provider-ci/providers/docker-build/repo/.github/workflows/run-acceptance-tests.yml index 48d808323b..9f8e822547 100644 --- a/native-provider-ci/providers/docker-build/repo/.github/workflows/run-acceptance-tests.yml +++ b/native-provider-ci/providers/docker-build/repo/.github/workflows/run-acceptance-tests.yml @@ -427,6 +427,9 @@ jobs: with: go-version: ${{ env.GOVERSION }} cache-dependency-path: "**/*.sum" + - name: Disarm go:embed directives to enable linters that compile source code + run: git grep -l 'go:embed' -- provider | xargs --no-run-if-empty sed -i + 's/go:embed/ goembed/g' - name: golangci-lint provider pkg uses: golangci/golangci-lint-action@d6238b002a20823d52840fda27e2d4891c5952dc # v4.0.1 with: diff --git a/native-provider-ci/providers/kubernetes-cert-manager/repo/.github/workflows/build.yml b/native-provider-ci/providers/kubernetes-cert-manager/repo/.github/workflows/build.yml index 867689a0f2..9c326ef925 100644 --- a/native-provider-ci/providers/kubernetes-cert-manager/repo/.github/workflows/build.yml +++ b/native-provider-ci/providers/kubernetes-cert-manager/repo/.github/workflows/build.yml @@ -506,6 +506,9 @@ jobs: with: go-version: ${{ env.GOVERSION }} cache-dependency-path: "**/*.sum" + - name: Disarm go:embed directives to enable linters that compile source code + run: git grep -l 'go:embed' -- provider | xargs --no-run-if-empty sed -i + 's/go:embed/ goembed/g' - name: golangci-lint provider pkg uses: golangci/golangci-lint-action@d6238b002a20823d52840fda27e2d4891c5952dc # v4.0.1 with: diff --git a/native-provider-ci/providers/kubernetes-cert-manager/repo/.github/workflows/run-acceptance-tests.yml b/native-provider-ci/providers/kubernetes-cert-manager/repo/.github/workflows/run-acceptance-tests.yml index 0bfc2cbce6..2c08cfd619 100644 --- a/native-provider-ci/providers/kubernetes-cert-manager/repo/.github/workflows/run-acceptance-tests.yml +++ b/native-provider-ci/providers/kubernetes-cert-manager/repo/.github/workflows/run-acceptance-tests.yml @@ -403,6 +403,9 @@ jobs: with: go-version: ${{ env.GOVERSION }} cache-dependency-path: "**/*.sum" + - name: Disarm go:embed directives to enable linters that compile source code + run: git grep -l 'go:embed' -- provider | xargs --no-run-if-empty sed -i + 's/go:embed/ goembed/g' - name: golangci-lint provider pkg uses: golangci/golangci-lint-action@d6238b002a20823d52840fda27e2d4891c5952dc # v4.0.1 with: diff --git a/native-provider-ci/providers/kubernetes/repo/.github/workflows/build.yml b/native-provider-ci/providers/kubernetes/repo/.github/workflows/build.yml index 81332adaaa..0d349b94af 100644 --- a/native-provider-ci/providers/kubernetes/repo/.github/workflows/build.yml +++ b/native-provider-ci/providers/kubernetes/repo/.github/workflows/build.yml @@ -549,6 +549,9 @@ jobs: with: go-version: ${{ env.GOVERSION }} cache-dependency-path: "**/*.sum" + - name: Disarm go:embed directives to enable linters that compile source code + run: git grep -l 'go:embed' -- provider | xargs --no-run-if-empty sed -i + 's/go:embed/ goembed/g' - name: golangci-lint provider pkg uses: golangci/golangci-lint-action@d6238b002a20823d52840fda27e2d4891c5952dc # v4.0.1 with: diff --git a/native-provider-ci/providers/kubernetes/repo/.github/workflows/run-acceptance-tests.yml b/native-provider-ci/providers/kubernetes/repo/.github/workflows/run-acceptance-tests.yml index 44f26e1db6..96eb6de1a7 100644 --- a/native-provider-ci/providers/kubernetes/repo/.github/workflows/run-acceptance-tests.yml +++ b/native-provider-ci/providers/kubernetes/repo/.github/workflows/run-acceptance-tests.yml @@ -443,6 +443,9 @@ jobs: with: go-version: ${{ env.GOVERSION }} cache-dependency-path: "**/*.sum" + - name: Disarm go:embed directives to enable linters that compile source code + run: git grep -l 'go:embed' -- provider | xargs --no-run-if-empty sed -i + 's/go:embed/ goembed/g' - name: golangci-lint provider pkg uses: golangci/golangci-lint-action@d6238b002a20823d52840fda27e2d4891c5952dc # v4.0.1 with: diff --git a/native-provider-ci/src/steps.ts b/native-provider-ci/src/steps.ts index ce1a6eb61f..24abc06847 100644 --- a/native-provider-ci/src/steps.ts +++ b/native-provider-ci/src/steps.ts @@ -912,8 +912,13 @@ export function InstallandConfigureHelm(provider: string): Step { return {}; } -export function GolangciLint(): Step { - return { +export function GolangciLint(): Step[] { + const disarmGoEmbed = { + name: "Disarm go:embed directives to enable linters that compile source code", + run: "git grep -l 'go:embed' -- provider | xargs --no-run-if-empty sed -i 's/go:embed/ goembed/g'", + }; + + const lintStep = { name: "golangci-lint provider pkg", uses: action.goLint, with: { @@ -922,6 +927,8 @@ export function GolangciLint(): Step { "working-directory": "provider", }, }; + + return [disarmGoEmbed, lintStep]; } export function CodegenDuringSDKBuild(provider: string) { diff --git a/native-provider-ci/src/workflows.ts b/native-provider-ci/src/workflows.ts index 530ed85ea6..83f41aeaaa 100644 --- a/native-provider-ci/src/workflows.ts +++ b/native-provider-ci/src/workflows.ts @@ -711,13 +711,17 @@ export class TeardownTestClusterJob implements NormalJob { export class LintJob implements NormalJob { "runs-on" = "ubuntu-latest"; - steps = [steps.CheckoutRepoStep(), steps.InstallGo(), steps.GolangciLint()]; + steps = [ + steps.CheckoutRepoStep(), + steps.InstallGo(), + ...steps.GolangciLint(), + ]; name: string; if: NormalJob["if"]; constructor(name: string) { this.name = name; - Object.assign(this, { name }); + Object.assign(this, { name, steps: this.steps }); } addDispatchConditional(isWorkflowDispatch: boolean) {