Skip to content

Commit 10f1552

Browse files
parkerbxyzgr2m
andauthored
test: integration tests (actions#40)
Co-authored-by: Gregor Martynus <[email protected]>
1 parent 49ce228 commit 10f1552

File tree

10 files changed

+2186
-173
lines changed

10 files changed

+2186
-173
lines changed

.github/workflows/test.yml

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,49 @@
11
name: test
22
on:
3+
push:
4+
branches:
5+
- main
36
pull_request:
47

58
concurrency:
69
group: ${{ github.workflow }}-${{ github.ref }}
710
cancel-in-progress: true
811

912
jobs:
10-
test:
13+
integration:
14+
name: Integration
1115
runs-on: ubuntu-latest
1216
steps:
1317
- uses: actions/checkout@v3
1418
- uses: actions/setup-node@v3
1519
with:
16-
node-version: "16.16"
20+
node-version: 20
21+
cache: "npm"
22+
- run: npm ci
23+
- run: npm run build
24+
- uses: ./ # Uses the action in the root directory
25+
id: test
26+
with:
27+
app_id: ${{ vars.TEST_APP_ID }}
28+
private_key: ${{ secrets.TEST_APP_PRIVATE_KEY }}
29+
- uses: octokit/[email protected]
30+
id: get-repository
31+
env:
32+
GITHUB_TOKEN: ${{ steps.test.outputs.token }}
33+
with:
34+
route: GET /installation/repositories
35+
- run: echo '${{ steps.get-repository.outputs.data }}'
36+
37+
end-to-end:
38+
name: End-to-End
39+
runs-on: ubuntu-latest
40+
# do not run from forks, as forks don’t have access to repository secrets
41+
if: github.repository_owner == 'actions'
42+
steps:
43+
- uses: actions/checkout@v3
44+
- uses: actions/setup-node@v3
45+
with:
46+
node-version: 20
1747
cache: "npm"
1848
- run: npm ci
1949
- run: npm run build

lib/post.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
export async function post(core, request) {
88
const token = core.getState("token");
99

10-
if (!token) return;
10+
if (!token) {
11+
core.info("Token is not set");
12+
return;
13+
}
1114

1215
await request("DELETE /installation/token", {
1316
headers: {

0 commit comments

Comments
 (0)