Skip to content

Commit f8e70cd

Browse files
committed
chore: rename ci.yaml to e2e-test.yaml, add build+lint CI workflow
- Rename ci.yaml → e2e-test.yaml (integration tests that exercise the action against a real PR) - Add new ci.yaml: runs npm ci → npm run build → npm run lint on every PR to main, intended as a required status check
1 parent 5b2401f commit f8e70cd

2 files changed

Lines changed: 91 additions & 75 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 11 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,16 @@
1-
on: pull_request
1+
name: CI
2+
on:
3+
pull_request:
4+
branches: [main]
25

36
jobs:
4-
test_comment_pr:
5-
name: (NRT) Comment PR
7+
build:
68
runs-on: ubuntu-latest
7-
permissions:
8-
pull-requests: write
99
steps:
10-
- name: Checkout
11-
uses: actions/checkout@v4
12-
13-
- name: (BEFORE) Setup test cases
14-
run: echo '**Content of file referenced with absolute path**' > /tmp/foobar.txt
15-
16-
- name: Comment PR with message
17-
uses: ./
18-
id: nrt-message
19-
with:
20-
message: |
21-
Current branch is `${{ github.head_ref }}`.
22-
_(execution **${{ github.run_id }}** / attempt **${{ github.run_attempt }}**)_
23-
comment-tag: nrt-message
24-
reactions: eyes, rocket
25-
mode: recreate
26-
27-
- name: Create a comment to delete it after
28-
uses: ./
29-
with:
30-
message: |
31-
This message will be deleted
32-
comment-tag: nrt-message-delete
33-
reactions: eyes
34-
35-
- name: Delete comment
36-
uses: ./
37-
with:
38-
comment-tag: nrt-message-delete
39-
mode: delete
40-
41-
- name: Comment PR with message that will be deleted
42-
uses: ./
10+
- uses: actions/checkout@v4
11+
- uses: actions/setup-node@v4
4312
with:
44-
message: |
45-
This PR is being built...
46-
comment-tag: nrt-message-delete-on-completion
47-
reactions: eyes
48-
mode: delete-on-completion
49-
50-
- name: Comment PR with file
51-
uses: ./
52-
with:
53-
file-path: README.md
54-
comment-tag: nrt-file
55-
reactions: eyes, rocket
56-
mode: recreate
57-
58-
- name: Comment PR with file (absolute path)
59-
uses: ./
60-
with:
61-
file-path: /tmp/foobar.txt
62-
comment-tag: nrt-file-absolute
63-
reactions: eyes, rocket
64-
mode: recreate
65-
66-
- name: Do not comment PR if not exists
67-
uses: ./
68-
with:
69-
message: Should not be printed
70-
comment-tag: nrt-create-if-not-exists
71-
create-if-not-exists: false
72-
73-
- name: Check outputs
74-
run: |
75-
echo "id : ${{ steps.nrt-message.outputs.id }}"
76-
echo "body : ${{ steps.nrt-message.outputs.body }}"
77-
echo "html-url : ${{ steps.nrt-message.outputs.html-url }}"
78-
79-
- name: (AFTER) Setup test cases
80-
run: rm /tmp/foobar.txt
13+
node-version: 24
14+
- run: npm ci
15+
- run: npm run build
16+
- run: npm run lint

.github/workflows/e2e-test.yaml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
on: pull_request
2+
3+
jobs:
4+
test_comment_pr:
5+
name: (NRT) Comment PR
6+
runs-on: ubuntu-latest
7+
permissions:
8+
pull-requests: write
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v4
12+
13+
- name: (BEFORE) Setup test cases
14+
run: echo '**Content of file referenced with absolute path**' > /tmp/foobar.txt
15+
16+
- name: Comment PR with message
17+
uses: ./
18+
id: nrt-message
19+
with:
20+
message: |
21+
Current branch is `${{ github.head_ref }}`.
22+
_(execution **${{ github.run_id }}** / attempt **${{ github.run_attempt }}**)_
23+
comment-tag: nrt-message
24+
reactions: eyes, rocket
25+
mode: recreate
26+
27+
- name: Create a comment to delete it after
28+
uses: ./
29+
with:
30+
message: |
31+
This message will be deleted
32+
comment-tag: nrt-message-delete
33+
reactions: eyes
34+
35+
- name: Delete comment
36+
uses: ./
37+
with:
38+
comment-tag: nrt-message-delete
39+
mode: delete
40+
41+
- name: Comment PR with message that will be deleted
42+
uses: ./
43+
with:
44+
message: |
45+
This PR is being built...
46+
comment-tag: nrt-message-delete-on-completion
47+
reactions: eyes
48+
mode: delete-on-completion
49+
50+
- name: Comment PR with file
51+
uses: ./
52+
with:
53+
file-path: README.md
54+
comment-tag: nrt-file
55+
reactions: eyes, rocket
56+
mode: recreate
57+
58+
- name: Comment PR with file (absolute path)
59+
uses: ./
60+
with:
61+
file-path: /tmp/foobar.txt
62+
comment-tag: nrt-file-absolute
63+
reactions: eyes, rocket
64+
mode: recreate
65+
66+
- name: Do not comment PR if not exists
67+
uses: ./
68+
with:
69+
message: Should not be printed
70+
comment-tag: nrt-create-if-not-exists
71+
create-if-not-exists: false
72+
73+
- name: Check outputs
74+
run: |
75+
echo "id : ${{ steps.nrt-message.outputs.id }}"
76+
echo "body : ${{ steps.nrt-message.outputs.body }}"
77+
echo "html-url : ${{ steps.nrt-message.outputs.html-url }}"
78+
79+
- name: (AFTER) Setup test cases
80+
run: rm /tmp/foobar.txt

0 commit comments

Comments
 (0)