Skip to content

Commit 0f52b2d

Browse files
authored
build: restore ci checks PLATTA-6231 (#782)
* build: ci workflows uses reusable workflow * build: sonar scan configurations * build: workflows uses latest versions on cache, checkout and setup-node actions * build: sports CSS size limit * build: check workflow to build and test * build: ci apps skip static generation
1 parent 9db49fd commit 0f52b2d

14 files changed

Lines changed: 294 additions & 106 deletions
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: CI-Events-Graphql-Proxy
2+
3+
on:
4+
push:
5+
branches: [main]
6+
# Only consider those paths to trigger the action
7+
paths:
8+
- 'proxies/events-graphql-proxy/**'
9+
- '.yarnrc.yml'
10+
- 'tsconfig.base.json'
11+
- '.prettier*'
12+
- '.github/workflows/ci-events-graphql-proxy-check.yml'
13+
14+
pull_request:
15+
branches: [main]
16+
# Only consider those paths to trigger the action
17+
paths:
18+
- 'proxies/events-graphql-proxy/**'
19+
- '.yarnrc.yml'
20+
- 'tsconfig.base.json'
21+
- '.prettier*'
22+
- '.github/workflows/ci-events-graphql-proxy-check.yml'
23+
workflow_dispatch:
24+
25+
jobs:
26+
common:
27+
uses: City-of-Helsinki/.github/.github/workflows/ci-node.yml@main
28+
secrets: inherit
29+
with:
30+
node-version: 20
31+
typecheck: true
32+
app-directory: proxies/events-graphql-proxy
33+
extra-commands: |
34+
echo "GRAPHQL_PROXY_PORT=4100" >> $GITHUB_ENV
35+
echo "GRAPHQL_PROXY_API_BASE_URL=https://api.hel.fi/linkedevents/v1/" >> $GITHUB_ENV
36+
echo "GRAPHQL_PROXY_MAP_OPEN_DATA_API_BASE_URL=https://kartta.hel.fi/ws/geoserver/avoindata" >> $GITHUB_ENV
37+
echo "GRAPHQL_PROXY_DISABLE_WINSTON_LOGGING=0" >> $GITHUB_ENV
38+
echo "GRAPHQL_PROXY_INTROSPECTION=1" >> $GITHUB_ENV
39+
echo "GRAPHQL_PROXY_SENTRY_ENVIRONMENT=development" >> $GITHUB_ENV
40+
echo "GRAPHQL_PROXY_SENTRY_DSN=https://0b946822a84596cdd0453aa5d93d3b9e@sentry.test.hel.ninja/219" >> $GITHUB_ENV
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: CI-Events-Helsinki
2+
3+
on:
4+
push:
5+
branches: [main]
6+
# Only consider those paths to trigger the action
7+
paths:
8+
- 'apps/events-helsinki/**'
9+
- 'packages/components/**'
10+
- 'packages/common-i18n/**'
11+
- '.yarnrc.yml'
12+
- 'tsconfig.base.json'
13+
- '.prettier*'
14+
- '.github/workflows/ci-events-helsinki-check.yml'
15+
16+
pull_request:
17+
branches: [main]
18+
# Only consider those paths to trigger the action
19+
paths:
20+
- 'apps/events-helsinki/**'
21+
- 'packages/components/**'
22+
- 'packages/common-i18n/**'
23+
- '.yarnrc.yml'
24+
- 'tsconfig.base.json'
25+
- '.prettier*'
26+
- '.github/workflows/ci-events-helsinki-check.yml'
27+
28+
env:
29+
CI: true
30+
FEDERATION_ROUTER_ENDPOINT: https://events-graphql-federation-events.test.hel.ninja/
31+
CMS_ORIGIN: https://tapahtumat.app-staging.hkih.hion.dev
32+
LINKEDEVENTS_EVENT_ENDPOINT: https://api.hel.fi/linkedevents/v1/event
33+
34+
jobs:
35+
common:
36+
uses: City-of-Helsinki/.github/.github/workflows/ci-node.yml@main
37+
secrets: inherit
38+
with:
39+
node-version: 20
40+
typecheck: true
41+
app-directory: apps/events-helsinki
42+
extra-commands: |
43+
# Timezone for tests
44+
echo "TZ=Europe/Helsinki" >> $GITHUB_ENV
45+
# Speed up build: they are linted in a previous step
46+
echo "NEXTJS_IGNORE_ESLINT=true" >> $GITHUB_ENV
47+
# Speed up build: they are typechecked in a previous step
48+
echo "NEXTJS_IGNORE_TYPECHECK=true" >> $GITHUB_ENV
49+
# Speed up build: don't run if not needed, enable if it becomes needed
50+
echo "NEXT_DISABLE_SOURCEMAPS=true" >> $GITHUB_ENV
51+
# Don't send telemetry for ci
52+
echo "NEXT_TELEMETRY_DISABLED=true" >> $GITHUB_ENV
53+
# To allow checking size-limits
54+
echo "NEXTJS_DISABLE_SENTRY=false" >> $GITHUB_ENV
55+
# Fully disable sentry upload
56+
echo "NEXTJS_SENTRY_UPLOAD_DRY_RUN=true" >> $GITHUB_ENV
57+
echo "FEDERATION_ROUTER_ENDPOINT=https://events-graphql-federation-events.test.hel.ninja/" >> $GITHUB_ENV
58+
echo "CMS_ORIGIN=https://tapahtumat.app-staging.hkih.hion.dev" >> $GITHUB_ENV
59+
echo "LINKEDEVENTS_EVENT_ENDPOINT=https://api.hel.fi/linkedevents/v1/event" >> $GITHUB_ENV
60+
# Mock origin
61+
echo "NEXT_PUBLIC_APP_ORIGIN=https://localhost:3001" >> $GITHUB_ENV
62+
echo "NEXT_PUBLIC_MATOMO_URL_BASE=//webanalytics.digiaiiris.com/js/" >> $GITHUB_ENV
63+
echo "NEXT_PUBLIC_MATOMO_SITE_ID=708" >> $GITHUB_ENV
64+
echo "NEXT_PUBLIC_MATOMO_SRC_URL=piwik.min.js" >> $GITHUB_ENV
65+
echo "NEXT_PUBLIC_MATOMO_TRACKER_URL=tracker.php" >> $GITHUB_ENV
66+
echo "NEXT_PUBLIC_MATOMO_ENABLED=0" >> $GITHUB_ENV
67+
echo "SKIP_BUILD_STATIC_GENERATION=1" >> $GITHUB_ENV
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: CI-Hobbies-Helsinki
2+
3+
on:
4+
push:
5+
branches: [main]
6+
# Only consider those paths to trigger the action
7+
paths:
8+
- 'apps/hobbies-helsinki/**'
9+
- 'packages/components/**'
10+
- 'packages/common-i18n/**'
11+
- '.yarnrc.yml'
12+
- 'tsconfig.base.json'
13+
- '.prettier*'
14+
- '.github/workflows/ci-hobbies-helsinki-check.yml'
15+
16+
pull_request:
17+
branches: [main]
18+
# Only consider those paths to trigger the action
19+
paths:
20+
- 'apps/hobbies-helsinki/**'
21+
- 'packages/components/**'
22+
- 'packages/common-i18n/**'
23+
- '.yarnrc.yml'
24+
- 'tsconfig.base.json'
25+
- '.prettier*'
26+
- '.github/workflows/ci-hobbies-helsinki-check.yml'
27+
workflow_dispatch:
28+
29+
jobs:
30+
common:
31+
uses: City-of-Helsinki/.github/.github/workflows/ci-node.yml@main
32+
secrets: inherit
33+
with:
34+
node-version: 20
35+
typecheck: true
36+
app-directory: apps/hobbies-helsinki
37+
extra-commands: |
38+
# Timezone for tests
39+
echo "TZ=Europe/Helsinki" >> $GITHUB_ENV
40+
# Speed up build: they are linted in a previous step
41+
echo "NEXTJS_IGNORE_ESLINT=true" >> $GITHUB_ENV
42+
# Speed up build: they are typechecked in a previous step
43+
echo "NEXTJS_IGNORE_TYPECHECK=true" >> $GITHUB_ENV
44+
# Speed up build: don't run if not needed, enable if it becomes needed
45+
echo "NEXT_DISABLE_SOURCEMAPS=true" >> $GITHUB_ENV
46+
# Don't send telemetry for ci
47+
echo "NEXT_TELEMETRY_DISABLED=true" >> $GITHUB_ENV
48+
# To allow checking size-limits
49+
echo "NEXTJS_DISABLE_SENTRY=false" >> $GITHUB_ENV
50+
# Fully disable sentry upload
51+
echo "NEXTJS_SENTRY_UPLOAD_DRY_RUN=true" >> $GITHUB_ENV
52+
echo "FEDERATION_ROUTER_ENDPOINT=https://events-graphql-federation-hobbies.test.hel.ninja/" >> $GITHUB_ENV
53+
echo "CMS_ORIGIN=https://harrastus.app-staging.hkih.hion.dev" >> $GITHUB_ENV
54+
echo "LINKEDEVENTS_EVENT_ENDPOINT=https://api.hel.fi/linkedevents/v1/event" >> $GITHUB_ENV
55+
# Mock origin
56+
echo "NEXT_PUBLIC_APP_ORIGIN=https://localhost:3001" >> $GITHUB_ENV
57+
echo "NEXT_PUBLIC_MATOMO_URL_BASE=//webanalytics.digiaiiris.com/js/" >> $GITHUB_ENV
58+
echo "NEXT_PUBLIC_MATOMO_SITE_ID=939" >> $GITHUB_ENV
59+
echo "NEXT_PUBLIC_MATOMO_SRC_URL=piwik.min.js" >> $GITHUB_ENV
60+
echo "NEXT_PUBLIC_MATOMO_TRACKER_URL=tracker.php" >> $GITHUB_ENV
61+
echo "NEXT_PUBLIC_MATOMO_ENABLED=0" >> $GITHUB_ENV
62+
echo "SKIP_BUILD_STATIC_GENERATION=1" >> $GITHUB_ENV

.github/workflows/ci-monorepo-integrity.yml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,18 @@ name: CI-monorepo-integrity
22

33
on:
44
push:
5-
branches:
6-
- dev
7-
- main
5+
branches: [main]
86
paths:
97
- 'yarn.lock'
108
- '.yarnrc.yml'
11-
- '.github/workflows/**'
9+
- '.github/workflows/ci-monorepo-integrity.yml'
1210

1311
pull_request:
14-
types:
15-
- opened
16-
- synchronize
17-
- reopened
12+
branches: [main]
1813
paths:
1914
- 'yarn.lock'
2015
- '.yarnrc.yml'
21-
- '.github/workflows/**'
16+
- '.github/workflows/ci-monorepo-integrity.yml'
2217

2318
jobs:
2419
test:
@@ -27,10 +22,10 @@ jobs:
2722
matrix:
2823
node-version: [20.x]
2924
steps:
30-
- uses: actions/checkout@v3
25+
- uses: actions/checkout@v4
3126

3227
- name: Use Node.js ${{ matrix.node-version }}
33-
uses: actions/setup-node@v3
28+
uses: actions/setup-node@v4
3429
with:
3530
node-version: ${{ matrix.node-version }}
3631

@@ -41,7 +36,7 @@ jobs:
4136
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
4237

4338
- name: Restore yarn cache
44-
uses: actions/cache@v3
39+
uses: actions/cache@v4
4540
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
4641
with:
4742
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}

.github/workflows/ci-packages.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212
- '.prettier*'
1313
- 'tsconfig.base.json'
1414
- '.prettier*'
15-
- '.github/workflows/**'
15+
- '.github/workflows/ci-packages.yml'
1616

1717
pull_request:
1818
types:
@@ -26,7 +26,7 @@ on:
2626
- '.prettier*'
2727
- 'tsconfig.base.json'
2828
- '.prettier*'
29-
- '.github/workflows/**'
29+
- '.github/workflows/ci-packages.yml'
3030

3131
env:
3232
CI: true
@@ -38,14 +38,14 @@ jobs:
3838
matrix:
3939
node-version: [20.x]
4040
steps:
41-
- uses: actions/checkout@v3
41+
- uses: actions/checkout@v4
4242
with:
4343
# Fetch all git history so that yarn workspaces --since can compare with the correct commits
4444
# @link https://github.com/actions/checkout#fetch-all-history-for-all-tags-and-branches
4545
fetch-depth: 0
4646

4747
- name: Use Node.js ${{ matrix.node-version }}
48-
uses: actions/setup-node@v3
48+
uses: actions/setup-node@v4
4949
with:
5050
node-version: ${{ matrix.node-version }}
5151

@@ -56,7 +56,7 @@ jobs:
5656
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
5757

5858
- name: Restore yarn cache
59-
uses: actions/cache@v3
59+
uses: actions/cache@v4
6060
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
6161
with:
6262
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
@@ -65,7 +65,7 @@ jobs:
6565
yarn-cache-folder-
6666
6767
- name: Restore packages cache
68-
uses: actions/cache@v3
68+
uses: actions/cache@v4
6969
with:
7070
path: |
7171
${{ github.workspace }}/.cache
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: CI-Sports-Helsinki
2+
3+
on:
4+
push:
5+
branches: [main]
6+
# Only consider those paths to trigger the action
7+
paths:
8+
- 'apps/sports-helsinki/**'
9+
- 'packages/components/**'
10+
- 'packages/common-i18n/**'
11+
- '.yarnrc.yml'
12+
- 'tsconfig.base.json'
13+
- '.prettier*'
14+
- '.github/workflows/ci-sports-helsinki-check.yml'
15+
16+
pull_request:
17+
branches: [main]
18+
# Only consider those paths to trigger the action
19+
paths:
20+
- 'apps/sports-helsinki/**'
21+
- 'packages/components/**'
22+
- 'packages/common-i18n/**'
23+
- '.yarnrc.yml'
24+
- 'tsconfig.base.json'
25+
- '.prettier*'
26+
- '.github/workflows/ci-sports-helsinki-check.yml'
27+
28+
jobs:
29+
common:
30+
uses: City-of-Helsinki/.github/.github/workflows/ci-node.yml@main
31+
secrets: inherit
32+
with:
33+
node-version: 20
34+
typecheck: true
35+
app-directory: apps/sports-helsinki
36+
extra-commands: |
37+
# Timezone for tests
38+
echo "TZ=Europe/Helsinki" >> $GITHUB_ENV
39+
# Speed up build: they are linted in a previous step
40+
echo "NEXTJS_IGNORE_ESLINT=true" >> $GITHUB_ENV
41+
# Speed up build: they are typechecked in a previous step
42+
echo "NEXTJS_IGNORE_TYPECHECK=true" >> $GITHUB_ENV
43+
# Speed up build: don't run if not needed, enable if it becomes needed
44+
echo "NEXT_DISABLE_SOURCEMAPS=true" >> $GITHUB_ENV
45+
# Don't send telemetry for ci
46+
echo "NEXT_TELEMETRY_DISABLED=true" >> $GITHUB_ENV
47+
# To allow checking size-limits
48+
echo "NEXTJS_DISABLE_SENTRY=false" >> $GITHUB_ENV
49+
# Fully disable sentry upload
50+
echo "NEXTJS_SENTRY_UPLOAD_DRY_RUN=true" >> $GITHUB_ENV
51+
echo "FEDERATION_ROUTER_ENDPOINT=https://events-graphql-federation-sports.test.hel.ninja/" >> $GITHUB_ENV
52+
echo "CMS_ORIGIN=https://liikunta.app-staging.hkih.hion.dev" >> $GITHUB_ENV
53+
echo "LINKEDEVENTS_EVENT_ENDPOINT=https://api.hel.fi/linkedevents/v1/event" >> $GITHUB_ENV
54+
# Mock origin
55+
echo "NEXT_PUBLIC_APP_ORIGIN=https://localhost:3001" >> $GITHUB_ENV
56+
echo "NEXT_PUBLIC_MATOMO_URL_BASE=//webanalytics.digiaiiris.com/js/" >> $GITHUB_ENV
57+
echo "NEXT_PUBLIC_MATOMO_SITE_ID=939" >> $GITHUB_ENV
58+
echo "NEXT_PUBLIC_MATOMO_SRC_URL=piwik.min.js" >> $GITHUB_ENV
59+
echo "NEXT_PUBLIC_MATOMO_TRACKER_URL=tracker.php" >> $GITHUB_ENV
60+
echo "NEXT_PUBLIC_MATOMO_ENABLED=0" >> $GITHUB_ENV
61+
echo "SKIP_BUILD_STATIC_GENERATION=1" >> $GITHUB_ENV

0 commit comments

Comments
 (0)