@@ -74,15 +74,89 @@ jobs:
7474 run : |
7575 go mod download
7676
77- - name : Run E2E # using retry because the GitHub token is being throttled.
77+ - name : Run PAT E2E # using retry because the GitHub token is being throttled.
7878 uses : nick-invision/retry@7f8f3d9f0f62fe5925341be21c2e8314fd4f7c7c
7979 env :
8080 GITHUB_AUTH_TOKEN : ${{ secrets.GH_AUTH_TOKEN }}
8181 with :
8282 max_attempts : 3
8383 retry_on : error
8484 timeout_minutes : 30
85- command : make e2e
85+ command : make e2e-pat
86+
87+ - name : codecov
88+ uses : codecov/codecov-action@e3c560433a6cc60aec8812599b7844a7b4fa0d71 # 2.1.0
89+ with :
90+ files : ./e2e-coverage.out
91+ verbose : true
92+
93+ - name : find comment
94+ uses : peter-evans/find-comment@1769778a0c5bd330272d749d12c036d65e70d39d # v1.2.0
95+ id : fc
96+ with :
97+ issue-number : ${{ github.event.pull_request.number || github.event.client_payload.pull_request.number }}
98+ comment-author : ' github-actions[bot]'
99+ body-includes : Integration tests ran for
100+
101+ - name : create or update comment
102+ uses : peter-evans/create-or-update-comment@c9fcb64660bc90ec1cc535646af190c992007c32 # v1.4.5
103+ with :
104+ issue-number : ${{ github.event.pull_request.number || github.event.client_payload.pull_request.number }}
105+ comment-id : ${{ steps.fc.outputs.comment-id }}
106+ body : |
107+ Integration tests ${{ job.status }} for
108+ [${{ github.event.client_payload.slash_command.args.named.sha || github.event.pull_request.head.sha }}]
109+ (https://github.com/ossf/scorecard/actions/runs/${{ github.run_id }})
110+
111+ integration-gh-token :
112+ runs-on : ubuntu-latest
113+ steps :
114+ - name : Harden Runner
115+ uses : step-security/harden-runner@bdb12b622a910dfdc99a31fdfe6f45a16bc287a4 # v1
116+ with :
117+ egress-policy : audit # TODO: change to 'egress-policy: block' after couple of runs
118+
119+ - name : pull_request actions/checkout
120+ uses : actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # v2.3.4
121+ with :
122+ ref : ${{ github.event.pull_request.head.sha }}
123+
124+ - name : setup-go
125+ uses : actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab # v2.2.0
126+ with :
127+ go-version : ' 1.17'
128+
129+ - name : Cache builds
130+ # https://github.com/mvdan/github-actions-golang#how-do-i-set-up-caching-between-builds
131+ uses : actions/cache@48af2dc4a9e8278b89d7fa154b955c30c6aaab09 # v2.1.7
132+ with :
133+ # In order:
134+ # * Module download cache
135+ # * Build cache (Linux)
136+ # * Build cache (Mac)
137+ # * Build cache (Windows)
138+ path : |
139+ ~/go/pkg/mod
140+ ~/.cache/go-build
141+ ~/Library/Caches/go-build
142+ %LocalAppData%\go-build
143+ key : ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
144+ restore-keys : |
145+ ${{ runner.os }}-go-
146+
147+ - name : Prepare test env
148+ run : |
149+ go mod download
150+
151+ - name : Run GITHUB_TOKEN E2E # using retry because the GitHub token is being throttled.
152+ uses : nick-invision/retry@7f8f3d9f0f62fe5925341be21c2e8314fd4f7c7c
153+ env :
154+ GITHUB_AUTH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
155+ with :
156+ max_attempts : 3
157+ retry_on : error
158+ timeout_minutes : 30
159+ command : make e2e-gh-token
86160
87161 - name : codecov
88162 uses : codecov/codecov-action@e3c560433a6cc60aec8812599b7844a7b4fa0d71 # 2.1.0
0 commit comments