-
Notifications
You must be signed in to change notification settings - Fork 2
49 lines (48 loc) · 1.61 KB
/
lint.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# WARNING: This file was build based on https://github.com/pulumi/ci-mgmt
# but it is currently not in sync. Any update must be done manually
name: lint
on:
workflow_call:
inputs: {}
env:
DOTNETVERSION: 7.0.x
JAVAVERSION: "11"
NODEVERSION: 20.x
PYTHONVERSION: "3.9"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} #TODO
TF_APPEND_USER_AGENT: pulumi
jobs:
lint:
name: lint
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Install go
uses: actions/setup-go@v5
with:
# The versions of golangci-lint and setup-go here cross-depend and need to update together.
go-version-file: provider/go.mod
# Either this action or golangci-lint needs to disable the cache
cache: false
- name: disarm go:embed directives to enable lint
continue-on-error: true # this fails if there are no go:embed directives
run: |
git grep -l 'go:embed' -- provider | xargs sed -i 's/go:embed/ goembed/g'
- name: prepare upstream
continue-on-error: true
run: make upstream
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.55.2
working-directory: provider
args: --timeout=30m --out-format=colored-line-number --skip-dirs "/opt|upstream|go/pkg/mod"
- if: failure() && github.event_name == 'push'
name: Notify Slack
uses: 8398a7/action-slack@v3
with:
author_name: Failure in linting provider
fields: repo,commit,author,action
status: ${{ job.status }}