-
-
Notifications
You must be signed in to change notification settings - Fork 15
61 lines (56 loc) · 2.16 KB
/
run-apollo-app-example.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: run-apollo-app-example
on:
workflow_dispatch: # * Treated like a scheduled run
inputs:
dist-tag:
type: string
description: NTARH version to test
required: true
default: 'latest'
schedule:
- cron: '30 */6 * * *'
env:
# * Selectively enable debugger verbose output in the pipeline
# ? See also: https://www.npmjs.com/package/debug#wildcards
# DEBUG: 'next-test-api-route-handler:*'
NODE_CURRENT_VERSION: 21.x
NODE_OLDER_VERSIONS: '"18.x", "20.x"'
jobs:
metadata:
name: 'gather-metadata'
runs-on: ubuntu-latest
timeout-minutes: 10
outputs:
node-matrix: ${{ steps.set-matrix.outputs.node-matrix }}
steps:
- name: Report mode statuses
run: |
if [ -n "$DEBUG" ]; then
echo "RUN-APOLLO-APP-EXAMPLE IS RUNNING IN DEBUG MODE ($DEBUG)"
else
echo '(run-apollo-app-example is not running in debug mode)'
fi
- name: Gather metadata
id: set-matrix
run: |
echo "::set-output name=node-matrix::{\"node\":[$NODE_OLDER_VERSIONS, \"$NODE_CURRENT_VERSION\"]}"
! [ -z "$DEBUG" ] && echo "set-output name=node-matrix::{\"node\":[$NODE_OLDER_VERSIONS, \"$NODE_CURRENT_VERSION\"]}" || true
check-compat:
runs-on: ubuntu-latest
needs: metadata
timeout-minutes: 10
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.metadata.outputs.node-matrix) }}
steps:
- name: Run apollo terminal example
# https://bit.ly/38702j0
run: |
mkdir -p /tmp/ntarh-test/test
cd /tmp/ntarh-test
npm install --force next @apollo/server @as-integrations/next graphql-tag next-test-api-route-handler jest babel-jest @babel/core @babel/preset-env --force
echo 'module.exports={"presets":["next/babel"]};' > babel.config.js
mkdir -p app/api/graphql
curl -o app/api/graphql/route.js https://raw.githubusercontent.com/Xunnamius/next-test-api-route-handler/main/apollo_test_raw_app_route
curl -o test/my.test.js https://raw.githubusercontent.com/Xunnamius/next-test-api-route-handler/main/apollo_test_raw_app_test
npx jest