@@ -2,9 +2,7 @@ name: Venue Graphql Proxy check
22
33on :
44 push :
5- branches :
6- - dev
7- - main
5+ branches : [main]
86 # Only consider those paths to trigger the action
97 paths :
108 - ' proxies/venue-graphql-proxy/**'
1412 - ' .github/workflows/**'
1513
1614 pull_request :
17- types :
18- - opened
19- - synchronize
20- - reopened
15+ branches : [main]
2116 # Only consider those paths to trigger the action
2217 paths :
2318 - ' proxies/venue-graphql-proxy/**'
2419 - ' .yarnrc.yml'
2520 - ' tsconfig.base.json'
2621 - ' .prettier*'
2722 - ' .github/workflows/**'
28-
29- env :
30- NODE_ENV : development
31- GRAPHQL_PROXY_DEBUG : debug
32- GRAPHQL_PROXY_PORT : 4100
33- GRAPHQL_PROXY_API_BASE_URL : https://api.hel.fi
34- GRAPHQL_PROXY_MAP_OPEN_DATA_API_BASE_URL : https://kartta.hel.fi/ws/geoserver/avoindata
35- GRAPHQL_PROXY_SENTRY_DSN :
36- GRAPHQL_PROXY_SENTRY_ENVIRONMENT : local
23+ workflow_dispatch :
3724
3825jobs :
39- test :
40- runs-on : ubuntu-latest
41- strategy :
42- matrix :
43- node-version : [16.x]
44- steps :
45- - uses : actions/checkout@v4
46-
47- - name : Use Node.js ${{ matrix.node-version }}
48- uses : actions/setup-node@v4
49- with :
50- node-version : ${{ matrix.node-version }}
51-
52- # Why not using setup-node 2.2+ cache option (yet) ?
53- # see https://github.com/belgattitude/nextjs-monorepo-example/pull/369
54- - name : Get yarn cache directory path
55- id : yarn-cache-dir-path
56- run : echo "::set-output name=dir::$(yarn config get cacheFolder)"
57-
58- - name : Restore yarn cache
59- uses : actions/cache@v4
60- id : yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
61- with :
62- path : ${{ steps.yarn-cache-dir-path.outputs.dir }}
63- key : yarn-cache-folder-${{ hashFiles('**/yarn.lock', '.yarnrc.yml') }}
64- restore-keys : |
65- yarn-cache-folder-
66-
67- - name : Install dependencies
68- run : |
69- yarn install --immutable --inline-builds
70- env :
71- HUSKY : 0
72-
73- - name : Typecheck
74- working-directory : proxies/venue-graphql-proxy
75- run : |
76- yarn typecheck
77-
78- - name : Linter
79- working-directory : proxies/venue-graphql-proxy
80- run : |
81- yarn lint
82-
83- - name : Unit tests
84- working-directory : proxies/venue-graphql-proxy
85- run : |
86- yarn test --coverage
87- env :
88- TZ : Europe/Helsinki
89- NEXT_PUBLIC_FEDERATION_ROUTER_ENDPOINT : ${{env.NEXT_PUBLIC_FEDERATION_ROUTER_ENDPOINT}}
90- NEXT_PUBLIC_CMS_ORIGIN : ${{env.NEXT_PUBLIC_CMS_ORIGIN}}
91- # Mock origin
92- NEXT_PUBLIC_APP_ORIGIN : https://localhost:3001
93-
94- - name : Build web-app
95- working-directory : proxies/venue-graphql-proxy
96- run : |
97- yarn build
98-
99- - name : Check ecmascript checks for build files
100- working-directory : proxies/venue-graphql-proxy
101- run : |
102- yarn check-dist
103- - name : Upload coverage report to Codecov
104- uses : codecov/codecov-action@v1
26+ common :
27+ uses : City-of-Helsinki/.github/.github/workflows/ci-node.yml@ci_node_parameters
28+ secrets : inherit
29+ with :
30+ node-version : 20
31+ typecheck : true
32+ app-directory : proxies/venue-graphql-proxy
33+ extra-commands : |
34+ echo "NODE_ENV=production" >> $GITHUB_ENV
35+ echo "GRAPHQL_PROXY_DEBUG=debug" >> $GITHUB_ENV
36+ echo "GRAPHQL_PROXY_PORT=4100" >> $GITHUB_ENV
37+ echo "GRAPHQL_PROXY_SENTRY_ENVIRONMENT=local" >> $GITHUB_ENV
38+ echo "GRAPHQL_PROXY_DISABLE_WINSTON_LOGGING=0" >> $GITHUB_ENV
39+ echo "GRAPHQL_PROXY_INTROSPECTION=1" >> $GITHUB_ENV
40+ # events proxy only
41+ echo "GRAPHQL_PROXY_MAP_OPEN_DATA_API_BASE_URL=https://kartta.hel.fi/ws/geoserver/avoindata" >> $GITHUB_ENV
42+ echo "GRAPHQL_PROXY_API_BASE_URL=https://api.hel.fi/linkedevents/v1/" >> $GITHUB_ENV
0 commit comments