From 2412b3f1c96bc8573004fffb582a3fef38b80eaa Mon Sep 17 00:00:00 2001 From: Dan Debrunner Date: Thu, 2 May 2024 14:33:24 -0400 Subject: [PATCH 1/7] chore: initial pr check --- .github/workflows/pr-check.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/pr-check.yaml diff --git a/.github/workflows/pr-check.yaml b/.github/workflows/pr-check.yaml new file mode 100644 index 0000000..efecb2d --- /dev/null +++ b/.github/workflows/pr-check.yaml @@ -0,0 +1,19 @@ +name: PR Checker +on: + pull_request: + types: [opened, synchronize, reopened] + workflow_dispatch: + +# cancel a previous check if running +# this avoids concurrent checks when multiple commits +# are pushed to a PR branch in a short time frame +# head_ref || ref_name ensures a value exists. +concurrency: + group: cb-${{ github.workflow }}-${{ github.head_ref || github.ref_name }} + cancel-in-progress: true + +jobs: + check-go-code: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 From 489c85b067500a444b5ddf93ca97cb7a18641c83 Mon Sep 17 00:00:00 2001 From: Dan Debrunner Date: Thu, 2 May 2024 14:38:47 -0400 Subject: [PATCH 2/7] chore: add stepzen service --- .github/workflows/pr-check.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/pr-check.yaml b/.github/workflows/pr-check.yaml index efecb2d..2d0cb9f 100644 --- a/.github/workflows/pr-check.yaml +++ b/.github/workflows/pr-check.yaml @@ -17,3 +17,14 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: "20" + - uses: stepzen-dev/stepzen-install@v1 + - name: start stepzen service + run: | + stepzen service start + - name: stop stepzen service + if: always + run: | + stepzen service stop From 5777a1bbae9390244b66366cd3a2a62da7c75b9e Mon Sep 17 00:00:00 2001 From: Dan Debrunner Date: Thu, 2 May 2024 14:41:43 -0400 Subject: [PATCH 3/7] chore: fix if condition --- .github/workflows/pr-check.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-check.yaml b/.github/workflows/pr-check.yaml index 2d0cb9f..2b3b340 100644 --- a/.github/workflows/pr-check.yaml +++ b/.github/workflows/pr-check.yaml @@ -25,6 +25,6 @@ jobs: run: | stepzen service start - name: stop stepzen service - if: always + if: ${{ !cancelled() }} run: | stepzen service stop From e0810bf622e29afadfcb2cb87bfea2bea8c7c0b5 Mon Sep 17 00:00:00 2001 From: Dan Debrunner Date: Thu, 2 May 2024 14:44:02 -0400 Subject: [PATCH 4/7] chore: add tests --- .github/workflows/pr-check.yaml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-check.yaml b/.github/workflows/pr-check.yaml index 2b3b340..7683165 100644 --- a/.github/workflows/pr-check.yaml +++ b/.github/workflows/pr-check.yaml @@ -21,10 +21,18 @@ jobs: with: node-version: "20" - uses: stepzen-dev/stepzen-install@v1 - - name: start stepzen service + - name: start service run: | stepzen service start - - name: stop stepzen service + - name: login + run: | + stepzen login --config ~/.stepzen/stepzen-config.local.yaml + - name: tests + run: | + cd tests + npm ci + npm test + - name: stop service if: ${{ !cancelled() }} run: | stepzen service stop From 54854b34f231f517a35bcd4703ddf15999241cd6 Mon Sep 17 00:00:00 2001 From: Dan Debrunner Date: Thu, 2 May 2024 14:49:06 -0400 Subject: [PATCH 5/7] chore: add STEPZEN_ENDPOINT --- .github/workflows/pr-check.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-check.yaml b/.github/workflows/pr-check.yaml index 7683165..b301991 100644 --- a/.github/workflows/pr-check.yaml +++ b/.github/workflows/pr-check.yaml @@ -13,7 +13,7 @@ concurrency: cancel-in-progress: true jobs: - check-go-code: + run-tests: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -32,6 +32,7 @@ jobs: cd tests npm ci npm test + env: STEPZEN_ENDPOINT=http://127.0.0.1:9000/test/snippets/graphql - name: stop service if: ${{ !cancelled() }} run: | From 6497b087324a76099233468730ab001aae80611d Mon Sep 17 00:00:00 2001 From: Dan Debrunner Date: Thu, 2 May 2024 14:49:52 -0400 Subject: [PATCH 6/7] chore: add STEPZEN_ENDPOINT --- .github/workflows/pr-check.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-check.yaml b/.github/workflows/pr-check.yaml index b301991..3049030 100644 --- a/.github/workflows/pr-check.yaml +++ b/.github/workflows/pr-check.yaml @@ -32,7 +32,8 @@ jobs: cd tests npm ci npm test - env: STEPZEN_ENDPOINT=http://127.0.0.1:9000/test/snippets/graphql + env: + STEPZEN_ENDPOINT: "http://127.0.0.1:9000/test/snippets/graphql" - name: stop service if: ${{ !cancelled() }} run: | From 5493a922f1e30b786b9be353ba7f5fab1cc3ae63 Mon Sep 17 00:00:00 2001 From: Dan Debrunner Date: Thu, 2 May 2024 15:10:51 -0400 Subject: [PATCH 7/7] use __graphql --- .github/workflows/pr-check.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-check.yaml b/.github/workflows/pr-check.yaml index 3049030..cd88b1a 100644 --- a/.github/workflows/pr-check.yaml +++ b/.github/workflows/pr-check.yaml @@ -33,7 +33,7 @@ jobs: npm ci npm test env: - STEPZEN_ENDPOINT: "http://127.0.0.1:9000/test/snippets/graphql" + STEPZEN_ENDPOINT: "http://127.0.0.1:9000/test/snippets/__graphql" - name: stop service if: ${{ !cancelled() }} run: |