Skip to content

Commit 5839df6

Browse files
authored
chore: initial pr check (#44)
* chore: initial pr check * chore: add stepzen service * chore: fix if condition * chore: add tests * chore: add STEPZEN_ENDPOINT * chore: add STEPZEN_ENDPOINT * use __graphql * Update pr-check.yaml
1 parent 4586caf commit 5839df6

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/pr-check.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: PR Checker
2+
on:
3+
pull_request:
4+
types: [opened, synchronize, reopened]
5+
workflow_dispatch:
6+
7+
# cancel a previous check if running
8+
# this avoids concurrent checks when multiple commits
9+
# are pushed to a PR branch in a short time frame
10+
# head_ref || ref_name ensures a value exists.
11+
concurrency:
12+
group: cb-${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
run-tests:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: actions/setup-node@v4
21+
with:
22+
node-version: "20"
23+
- uses: stepzen-dev/stepzen-install@v1
24+
- name: start service
25+
run: |
26+
stepzen service start
27+
- name: login into local service
28+
run: |
29+
stepzen login --config ~/.stepzen/stepzen-config.local.yaml
30+
- name: tests
31+
run: |
32+
cd tests
33+
npm ci
34+
npm test
35+
env:
36+
STEPZEN_ENDPOINT: "http://127.0.0.1:9000/test/snippets/__graphql"
37+
- name: stop service
38+
if: ${{ !cancelled() }}
39+
run: |
40+
stepzen service stop

0 commit comments

Comments
 (0)