From a532939702436963fac159174e788bb613419e91 Mon Sep 17 00:00:00 2001 From: Tero Virtanen Date: Wed, 25 Jun 2025 13:56:42 +0300 Subject: [PATCH 01/19] build: restore ci checks PLATTA-6231 --- .../workflows/ci-events-helsinki-check.yml | 151 ++++++++++++++++++ .../workflows/ci-hobbies-helsinki-check.yml | 151 ++++++++++++++++++ .github/workflows/ci-monorepo-integrity.yml | 6 +- .github/workflows/ci-packages.yml | 8 +- .../workflows/ci-sports-helsinki-check.yml | 151 ++++++++++++++++++ .../ci-venue-graphql-proxy-check.yml | 6 +- .github/workflows/codesee-arch-diagram.yml | 4 +- 7 files changed, 465 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/ci-events-helsinki-check.yml create mode 100644 .github/workflows/ci-hobbies-helsinki-check.yml create mode 100644 .github/workflows/ci-sports-helsinki-check.yml diff --git a/.github/workflows/ci-events-helsinki-check.yml b/.github/workflows/ci-events-helsinki-check.yml new file mode 100644 index 000000000..03f176f96 --- /dev/null +++ b/.github/workflows/ci-events-helsinki-check.yml @@ -0,0 +1,151 @@ +name: CI-Events-Helsinki + +on: + push: + branches: + - dev + - main + # Only consider those paths to trigger the action + paths: + - 'apps/events-helsinki/**' + - 'packages/components/**' + - 'packages/common-i18n/**' + - '.yarnrc.yml' + - 'tsconfig.base.json' + - '.prettier*' + - '.github/workflows/**' + + pull_request: + types: + - opened + - synchronize + - reopened + # Only consider those paths to trigger the action + paths: + - 'apps/events-helsinki/**' + - 'packages/components/**' + - 'packages/common-i18n/**' + - '.yarnrc.yml' + - 'tsconfig.base.json' + - '.prettier*' + - '.github/workflows/**' + +env: + CI: true + FEDERATION_ROUTER_ENDPOINT: https://events-graphql-federation-events.test.hel.ninja/ + CMS_ORIGIN: https://tapahtumat.app-staging.hkih.hion.dev + LINKEDEVENTS_EVENT_ENDPOINT: https://api.hel.fi/linkedevents/v1/event + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [20.x] + steps: + - uses: actions/checkout@v4 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + + # Why not using setup-node 2.2+ cache option (yet) ? + # see https://github.com/belgattitude/nextjs-monorepo-example/pull/369 + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn config get cacheFolder)" + + - name: Restore yarn cache + uses: actions/cache@v4 + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: yarn-cache-folder-${{ hashFiles('**/yarn.lock', '.yarnrc.yml') }} + restore-keys: | + yarn-cache-folder- + + # see https://github.com/vercel/next.js/pull/27362 + - name: Restore nextjs build events-helsinki from cache + uses: actions/cache@v4 + with: + path: | + ${{ github.workspace }}/apps/events-helsinki/.next/cache + ${{ github.workspace }}/.cache + ${{ github.workspace }}/**/tsconfig.tsbuildinfo + + key: ${{ runner.os }}-events-helsinki-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('apps/events-helsinki/src/**.[jt]sx?', 'apps/events-helsinki/src/**.json') }} + restore-keys: | + ${{ runner.os }}-events-helsinki-${{ hashFiles('**/yarn.lock') }}- + + - name: Install dependencies + run: | + yarn install --immutable --inline-builds + env: + HUSKY: 0 + + - name: Typecheck + working-directory: apps/events-helsinki + run: | + yarn typecheck + + - name: Linter + working-directory: apps/events-helsinki + run: | + yarn lint + + - name: Unit tests + working-directory: apps/events-helsinki + run: | + yarn test --coverage + env: + TZ: Europe/Helsinki + FEDERATION_ROUTER_ENDPOINT: ${{env.FEDERATION_ROUTER_ENDPOINT}} + CMS_ORIGIN: ${{env.CMS_ORIGIN}} + LINKEDEVENTS_EVENT_ENDPOINT: ${{env.LINKEDEVENTS_EVENT_ENDPOINT}} + # Mock origin + NEXT_PUBLIC_APP_ORIGIN: https://localhost:3001 + + - name: SonarQube Cloud Scan + uses: SonarSource/sonarqube-scan-action@v5.1.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + + - name: Build web-app + working-directory: apps/events-helsinki + run: | + yarn build + env: + # Speed up build: they are linted in a previous step + NEXTJS_IGNORE_ESLINT: true + # Speed up build: they are typechecked in a previous step + NEXTJS_IGNORE_TYPECHECK: true + # Speed up build: don't run if not needed, enable if it becomes needed + NEXT_DISABLE_SOURCEMAPS: true + # Don't send telemetry for ci + NEXT_TELEMETRY_DISABLED: true + # To allow checking size-limits + NEXTJS_DISABLE_SENTRY: false + # Fully disable sentry upload + NEXTJS_SENTRY_UPLOAD_DRY_RUN: true + FEDERATION_ROUTER_ENDPOINT: ${{env.FEDERATION_ROUTER_ENDPOINT}} + CMS_ORIGIN: ${{env.CMS_ORIGIN}} + LINKEDEVENTS_EVENT_ENDPOINT: ${{env.LINKEDEVENTS_EVENT_ENDPOINT}} + # Mock origin + NEXT_PUBLIC_APP_ORIGIN: https://localhost:3001 + NEXT_PUBLIC_MATOMO_URL_BASE: '//webanalytics.digiaiiris.com/js/' + NEXT_PUBLIC_MATOMO_SITE_ID: 708 + NEXT_PUBLIC_MATOMO_SRC_URL: 'piwik.min.js' + NEXT_PUBLIC_MATOMO_TRACKER_URL: 'tracker.php' + NEXT_PUBLIC_MATOMO_ENABLED: 0 + + - name: Check browser bundle size limits + working-directory: apps/events-helsinki + run: | + yarn check-size + + - name: Check ecmascript checks for build files + working-directory: apps/events-helsinki + run: | + yarn check-dist diff --git a/.github/workflows/ci-hobbies-helsinki-check.yml b/.github/workflows/ci-hobbies-helsinki-check.yml new file mode 100644 index 000000000..33fa525da --- /dev/null +++ b/.github/workflows/ci-hobbies-helsinki-check.yml @@ -0,0 +1,151 @@ +name: CI-Hobbies-Helsinki + +on: + push: + branches: + - dev + - main + # Only consider those paths to trigger the action + paths: + - 'apps/hobbies-helsinki/**' + - 'packages/components/**' + - 'packages/common-i18n/**' + - '.yarnrc.yml' + - 'tsconfig.base.json' + - '.prettier*' + - '.github/workflows/**' + + pull_request: + types: + - opened + - synchronize + - reopened + # Only consider those paths to trigger the action + paths: + - 'apps/hobbies-helsinki/**' + - 'packages/components/**' + - 'packages/common-i18n/**' + - '.yarnrc.yml' + - 'tsconfig.base.json' + - '.prettier*' + - '.github/workflows/**' + +env: + CI: true + FEDERATION_ROUTER_ENDPOINT: https://events-graphql-federation-hobbies.test.hel.ninja/ + CMS_ORIGIN: https://harrastus.app-staging.hkih.hion.dev + LINKEDEVENTS_EVENT_ENDPOINT: https://api.hel.fi/linkedevents/v1/event + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [20.x] + steps: + - uses: actions/checkout@v4 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + + # Why not using setup-node 2.2+ cache option (yet) ? + # see https://github.com/belgattitude/nextjs-monorepo-example/pull/369 + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn config get cacheFolder)" + + - name: Restore yarn cache + uses: actions/cache@v4 + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: yarn-cache-folder-${{ hashFiles('**/yarn.lock', '.yarnrc.yml') }} + restore-keys: | + yarn-cache-folder- + + # see https://github.com/vercel/next.js/pull/27362 + - name: Restore nextjs build hobbies-helsinki from cache + uses: actions/cache@v4 + with: + path: | + ${{ github.workspace }}/apps/hobbies-helsinki/.next/cache + ${{ github.workspace }}/.cache + ${{ github.workspace }}/**/tsconfig.tsbuildinfo + + key: ${{ runner.os }}-hobbies-helsinki-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('apps/hobbies-helsinki/src/**.[jt]sx?', 'apps/hobbies-helsinki/src/**.json') }} + restore-keys: | + ${{ runner.os }}-hobbies-helsinki-${{ hashFiles('**/yarn.lock') }}- + + - name: Install dependencies + run: | + yarn install --immutable --inline-builds + env: + HUSKY: 0 + + - name: Typecheck + working-directory: apps/hobbies-helsinki + run: | + yarn typecheck + + - name: Linter + working-directory: apps/hobbies-helsinki + run: | + yarn lint + + - name: Unit tests + working-directory: apps/hobbies-helsinki + run: | + yarn test --coverage + env: + TZ: Europe/Helsinki + FEDERATION_ROUTER_ENDPOINT: ${{env.FEDERATION_ROUTER_ENDPOINT}} + CMS_ORIGIN: ${{env.CMS_ORIGIN}} + LINKEDEVENTS_EVENT_ENDPOINT: ${{env.LINKEDEVENTS_EVENT_ENDPOINT}} + # Mock origin + NEXT_PUBLIC_APP_ORIGIN: https://localhost:3001 + + - name: SonarQube Cloud Scan + uses: SonarSource/sonarqube-scan-action@v5.1.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + + - name: Build web-app + working-directory: apps/hobbies-helsinki + run: | + yarn build + env: + # Speed up build: they are linted in a previous step + NEXTJS_IGNORE_ESLINT: true + # Speed up build: they are typechecked in a previous step + NEXTJS_IGNORE_TYPECHECK: true + # Speed up build: don't run if not needed, enable if it becomes needed + NEXT_DISABLE_SOURCEMAPS: true + # Don't send telemetry for ci + NEXT_TELEMETRY_DISABLED: true + # To allow checking size-limits + NEXTJS_DISABLE_SENTRY: false + # Fully disable sentry upload + NEXTJS_SENTRY_UPLOAD_DRY_RUN: true + FEDERATION_ROUTER_ENDPOINT: ${{env.FEDERATION_ROUTER_ENDPOINT}} + CMS_ORIGIN: ${{env.CMS_ORIGIN}} + LINKEDEVENTS_EVENT_ENDPOINT: ${{env.LINKEDEVENTS_EVENT_ENDPOINT}} + # Mock origin + NEXT_PUBLIC_APP_ORIGIN: https://localhost:3001 + NEXT_PUBLIC_MATOMO_URL_BASE: '//webanalytics.digiaiiris.com/js/' + NEXT_PUBLIC_MATOMO_SITE_ID: 939 + NEXT_PUBLIC_MATOMO_SRC_URL: 'piwik.min.js' + NEXT_PUBLIC_MATOMO_TRACKER_URL: 'tracker.php' + NEXT_PUBLIC_MATOMO_ENABLED: 0 + + - name: Check browser bundle size limits + working-directory: apps/hobbies-helsinki + run: | + yarn check-size + + - name: Check ecmascript checks for build files + working-directory: apps/hobbies-helsinki + run: | + yarn check-dist diff --git a/.github/workflows/ci-monorepo-integrity.yml b/.github/workflows/ci-monorepo-integrity.yml index 21b106487..3b394a838 100644 --- a/.github/workflows/ci-monorepo-integrity.yml +++ b/.github/workflows/ci-monorepo-integrity.yml @@ -27,10 +27,10 @@ jobs: matrix: node-version: [16.x] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} @@ -41,7 +41,7 @@ jobs: run: echo "::set-output name=dir::$(yarn config get cacheFolder)" - name: Restore yarn cache - uses: actions/cache@v3 + uses: actions/cache@v4 id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) with: path: ${{ steps.yarn-cache-dir-path.outputs.dir }} diff --git a/.github/workflows/ci-packages.yml b/.github/workflows/ci-packages.yml index 36376fce5..4faa1c6cf 100644 --- a/.github/workflows/ci-packages.yml +++ b/.github/workflows/ci-packages.yml @@ -38,14 +38,14 @@ jobs: matrix: node-version: [16.x] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: # Fetch all git history so that yarn workspaces --since can compare with the correct commits # @link https://github.com/actions/checkout#fetch-all-history-for-all-tags-and-branches fetch-depth: 0 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} @@ -56,7 +56,7 @@ jobs: run: echo "::set-output name=dir::$(yarn config get cacheFolder)" - name: Restore yarn cache - uses: actions/cache@v3 + uses: actions/cache@v4 id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) with: path: ${{ steps.yarn-cache-dir-path.outputs.dir }} @@ -65,7 +65,7 @@ jobs: yarn-cache-folder- - name: Restore packages cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | ${{ github.workspace }}/.cache diff --git a/.github/workflows/ci-sports-helsinki-check.yml b/.github/workflows/ci-sports-helsinki-check.yml new file mode 100644 index 000000000..0e1d7014f --- /dev/null +++ b/.github/workflows/ci-sports-helsinki-check.yml @@ -0,0 +1,151 @@ +name: CI-Sports-Helsinki + +on: + push: + branches: + - dev + - main + # Only consider those paths to trigger the action + paths: + - 'apps/sports-helsinki/**' + - 'packages/components/**' + - 'packages/common-i18n/**' + - '.yarnrc.yml' + - 'tsconfig.base.json' + - '.prettier*' + - '.github/workflows/**' + + pull_request: + types: + - opened + - synchronize + - reopened + # Only consider those paths to trigger the action + paths: + - 'apps/sports-helsinki/**' + - 'packages/components/**' + - 'packages/common-i18n/**' + - '.yarnrc.yml' + - 'tsconfig.base.json' + - '.prettier*' + - '.github/workflows/**' + +env: + CI: true + FEDERATION_ROUTER_ENDPOINT: https://events-graphql-federation-sports.test.hel.ninja/ + CMS_ORIGIN: https://liikunta.app-staging.hkih.hion.dev + LINKEDEVENTS_EVENT_ENDPOINT: https://api.hel.fi/linkedevents/v1/event + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [20.x] + steps: + - uses: actions/checkout@v4 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + + # Why not using setup-node 2.2+ cache option (yet) ? + # see https://github.com/belgattitude/nextjs-monorepo-example/pull/369 + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn config get cacheFolder)" + + - name: Restore yarn cache + uses: actions/cache@v4 + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: yarn-cache-folder-${{ hashFiles('**/yarn.lock', '.yarnrc.yml') }} + restore-keys: | + yarn-cache-folder- + + # see https://github.com/vercel/next.js/pull/27362 + - name: Restore nextjs build sports-helsinki from cache + uses: actions/cache@v4 + with: + path: | + ${{ github.workspace }}/apps/sports-helsinki/.next/cache + ${{ github.workspace }}/.cache + ${{ github.workspace }}/**/tsconfig.tsbuildinfo + + key: ${{ runner.os }}-sports-helsinki-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('apps/sports-helsinki/src/**.[jt]sx?', 'apps/sports-helsinki/src/**.json') }} + restore-keys: | + ${{ runner.os }}-sports-helsinki-${{ hashFiles('**/yarn.lock') }}- + + - name: Install dependencies + run: | + yarn install --immutable --inline-builds + env: + HUSKY: 0 + + - name: Typecheck + working-directory: apps/sports-helsinki + run: | + yarn typecheck + + - name: Linter + working-directory: apps/sports-helsinki + run: | + yarn lint + + - name: Unit tests + working-directory: apps/sports-helsinki + run: | + yarn test --coverage + env: + TZ: Europe/Helsinki + FEDERATION_ROUTER_ENDPOINT: ${{env.FEDERATION_ROUTER_ENDPOINT}} + CMS_ORIGIN: ${{env.CMS_ORIGIN}} + LINKEDEVENTS_EVENT_ENDPOINT: ${{env.LINKEDEVENTS_EVENT_ENDPOINT}} + # Mock origin + NEXT_PUBLIC_APP_ORIGIN: https://localhost:3001 + + - name: SonarQube Cloud Scan + uses: SonarSource/sonarqube-scan-action@v5.1.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + + - name: Build web-app + working-directory: apps/sports-helsinki + run: | + yarn build + env: + # Speed up build: they are linted in a previous step + NEXTJS_IGNORE_ESLINT: true + # Speed up build: they are typechecked in a previous step + NEXTJS_IGNORE_TYPECHECK: true + # Speed up build: don't run if not needed, enable if it becomes needed + NEXT_DISABLE_SOURCEMAPS: true + # Don't send telemetry for ci + NEXT_TELEMETRY_DISABLED: true + # To allow checking size-limits + NEXTJS_DISABLE_SENTRY: false + # Fully disable sentry upload + NEXTJS_SENTRY_UPLOAD_DRY_RUN: true + FEDERATION_ROUTER_ENDPOINT: ${{env.FEDERATION_ROUTER_ENDPOINT}} + CMS_ORIGIN: ${{env.CMS_ORIGIN}} + LINKEDEVENTS_EVENT_ENDPOINT: ${{env.LINKEDEVENTS_EVENT_ENDPOINT}} + # Mock origin + NEXT_PUBLIC_APP_ORIGIN: https://localhost:3001 + NEXT_PUBLIC_MATOMO_URL_BASE: '//webanalytics.digiaiiris.com/js/' + NEXT_PUBLIC_MATOMO_SITE_ID: 939 + NEXT_PUBLIC_MATOMO_SRC_URL: 'piwik.min.js' + NEXT_PUBLIC_MATOMO_TRACKER_URL: 'tracker.php' + NEXT_PUBLIC_MATOMO_ENABLED: 0 + + - name: Check browser bundle size limits + working-directory: apps/sports-helsinki + run: | + yarn check-size + + - name: Check ecmascript checks for build files + working-directory: apps/sports-helsinki + run: | + yarn check-dist diff --git a/.github/workflows/ci-venue-graphql-proxy-check.yml b/.github/workflows/ci-venue-graphql-proxy-check.yml index 63808f75d..ab40b326a 100644 --- a/.github/workflows/ci-venue-graphql-proxy-check.yml +++ b/.github/workflows/ci-venue-graphql-proxy-check.yml @@ -42,10 +42,10 @@ jobs: matrix: node-version: [16.x] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} @@ -56,7 +56,7 @@ jobs: run: echo "::set-output name=dir::$(yarn config get cacheFolder)" - name: Restore yarn cache - uses: actions/cache@v3 + uses: actions/cache@v4 id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) with: path: ${{ steps.yarn-cache-dir-path.outputs.dir }} diff --git a/.github/workflows/codesee-arch-diagram.yml b/.github/workflows/codesee-arch-diagram.yml index 4c27192e8..6f8e6d8ac 100644 --- a/.github/workflows/codesee-arch-diagram.yml +++ b/.github/workflows/codesee-arch-diagram.yml @@ -15,7 +15,7 @@ jobs: steps: - name: checkout id: checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: ${{ github.event.pull_request.head.repo.full_name }} ref: ${{ github.event.pull_request.head.ref }} @@ -36,7 +36,7 @@ jobs: # CodeSee Maps Go support uses a static binary so there's no setup step required. - name: Configure Node.js 16 - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 if: ${{ fromJSON(steps.detect-languages.outputs.languages).javascript }} with: node-version: '14' From 27907b843c9735e6a48d44bf7b08863ffad5cd75 Mon Sep 17 00:00:00 2001 From: Tero Virtanen Date: Wed, 25 Jun 2025 14:31:11 +0300 Subject: [PATCH 02/19] build: hobbies-helsinki sonar scan --- .github/workflows/ci-hobbies-helsinki-check.yml | 2 ++ apps/hobbies-helsinki/sonar-project.properties | 5 +++++ 2 files changed, 7 insertions(+) create mode 100644 apps/hobbies-helsinki/sonar-project.properties diff --git a/.github/workflows/ci-hobbies-helsinki-check.yml b/.github/workflows/ci-hobbies-helsinki-check.yml index 33fa525da..3429439d3 100644 --- a/.github/workflows/ci-hobbies-helsinki-check.yml +++ b/.github/workflows/ci-hobbies-helsinki-check.yml @@ -108,6 +108,8 @@ jobs: - name: SonarQube Cloud Scan uses: SonarSource/sonarqube-scan-action@v5.1.0 + with: + projectBaseDir: apps/hobbies-helsinki env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/apps/hobbies-helsinki/sonar-project.properties b/apps/hobbies-helsinki/sonar-project.properties new file mode 100644 index 000000000..038bfcc07 --- /dev/null +++ b/apps/hobbies-helsinki/sonar-project.properties @@ -0,0 +1,5 @@ +sonar.projectKey = City-of-Helsinki_harrastukset-ui +sonar.organization = city-of-helsinki +sonar.exclusions = **/__tests__/**,**/browser-tests/** +sonar.sources = src +sonar.javascript.lcov.reportPaths = coverage/lcov.info \ No newline at end of file From 2cb8ade8aaaeda08e0b6fc64e61a9ab87148cc97 Mon Sep 17 00:00:00 2001 From: Tero Virtanen Date: Wed, 25 Jun 2025 14:57:55 +0300 Subject: [PATCH 03/19] build: check workflow to build and test --- .../workflows/ci-events-helsinki-check.yml | 2 + .../workflows/ci-hobbies-helsinki-check.yml | 114 +++++++++--------- .../workflows/ci-sports-helsinki-check.yml | 2 + apps/events-helsinki/sonar-project.properties | 5 + apps/sports-helsinki/sonar-project.properties | 5 + 5 files changed, 69 insertions(+), 59 deletions(-) create mode 100644 apps/events-helsinki/sonar-project.properties create mode 100644 apps/sports-helsinki/sonar-project.properties diff --git a/.github/workflows/ci-events-helsinki-check.yml b/.github/workflows/ci-events-helsinki-check.yml index 03f176f96..cc1a34f59 100644 --- a/.github/workflows/ci-events-helsinki-check.yml +++ b/.github/workflows/ci-events-helsinki-check.yml @@ -108,6 +108,8 @@ jobs: - name: SonarQube Cloud Scan uses: SonarSource/sonarqube-scan-action@v5.1.0 + with: + projectBaseDir: apps/events-helsinki env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/.github/workflows/ci-hobbies-helsinki-check.yml b/.github/workflows/ci-hobbies-helsinki-check.yml index 3429439d3..43ed53251 100644 --- a/.github/workflows/ci-hobbies-helsinki-check.yml +++ b/.github/workflows/ci-hobbies-helsinki-check.yml @@ -37,7 +37,8 @@ env: LINKEDEVENTS_EVENT_ENDPOINT: https://api.hel.fi/linkedevents/v1/event jobs: - test: + build: + name: Lint and build runs-on: ubuntu-latest strategy: matrix: @@ -49,34 +50,7 @@ jobs: uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - - # Why not using setup-node 2.2+ cache option (yet) ? - # see https://github.com/belgattitude/nextjs-monorepo-example/pull/369 - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn config get cacheFolder)" - - - name: Restore yarn cache - uses: actions/cache@v4 - id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: yarn-cache-folder-${{ hashFiles('**/yarn.lock', '.yarnrc.yml') }} - restore-keys: | - yarn-cache-folder- - - # see https://github.com/vercel/next.js/pull/27362 - - name: Restore nextjs build hobbies-helsinki from cache - uses: actions/cache@v4 - with: - path: | - ${{ github.workspace }}/apps/hobbies-helsinki/.next/cache - ${{ github.workspace }}/.cache - ${{ github.workspace }}/**/tsconfig.tsbuildinfo - - key: ${{ runner.os }}-hobbies-helsinki-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('apps/hobbies-helsinki/src/**.[jt]sx?', 'apps/hobbies-helsinki/src/**.json') }} - restore-keys: | - ${{ runner.os }}-hobbies-helsinki-${{ hashFiles('**/yarn.lock') }}- + cache: 'yarn' - name: Install dependencies run: | @@ -84,36 +58,6 @@ jobs: env: HUSKY: 0 - - name: Typecheck - working-directory: apps/hobbies-helsinki - run: | - yarn typecheck - - - name: Linter - working-directory: apps/hobbies-helsinki - run: | - yarn lint - - - name: Unit tests - working-directory: apps/hobbies-helsinki - run: | - yarn test --coverage - env: - TZ: Europe/Helsinki - FEDERATION_ROUTER_ENDPOINT: ${{env.FEDERATION_ROUTER_ENDPOINT}} - CMS_ORIGIN: ${{env.CMS_ORIGIN}} - LINKEDEVENTS_EVENT_ENDPOINT: ${{env.LINKEDEVENTS_EVENT_ENDPOINT}} - # Mock origin - NEXT_PUBLIC_APP_ORIGIN: https://localhost:3001 - - - name: SonarQube Cloud Scan - uses: SonarSource/sonarqube-scan-action@v5.1.0 - with: - projectBaseDir: apps/hobbies-helsinki - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - - name: Build web-app working-directory: apps/hobbies-helsinki run: | @@ -151,3 +95,55 @@ jobs: working-directory: apps/hobbies-helsinki run: | yarn check-dist + + test: + name: Test + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [20.x] + steps: + - uses: actions/checkout@v4 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'yarn' + + - name: Install dependencies + run: | + yarn install --immutable --inline-builds + env: + HUSKY: 0 + + - name: Typecheck + working-directory: apps/hobbies-helsinki + run: | + yarn typecheck + + - name: Linter + working-directory: apps/hobbies-helsinki + run: | + yarn lint + + - name: Unit tests + working-directory: apps/hobbies-helsinki + run: | + yarn test --coverage + env: + TZ: Europe/Helsinki + FEDERATION_ROUTER_ENDPOINT: ${{env.FEDERATION_ROUTER_ENDPOINT}} + CMS_ORIGIN: ${{env.CMS_ORIGIN}} + LINKEDEVENTS_EVENT_ENDPOINT: ${{env.LINKEDEVENTS_EVENT_ENDPOINT}} + # Mock origin + NEXT_PUBLIC_APP_ORIGIN: https://localhost:3001 + + - name: SonarQube Cloud Scan + uses: SonarSource/sonarqube-scan-action@v5.1.0 + with: + projectBaseDir: apps/hobbies-helsinki + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + diff --git a/.github/workflows/ci-sports-helsinki-check.yml b/.github/workflows/ci-sports-helsinki-check.yml index 0e1d7014f..bccda558b 100644 --- a/.github/workflows/ci-sports-helsinki-check.yml +++ b/.github/workflows/ci-sports-helsinki-check.yml @@ -108,6 +108,8 @@ jobs: - name: SonarQube Cloud Scan uses: SonarSource/sonarqube-scan-action@v5.1.0 + with: + projectBaseDir: apps/sports-helsinki env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/apps/events-helsinki/sonar-project.properties b/apps/events-helsinki/sonar-project.properties new file mode 100644 index 000000000..dd487f3ed --- /dev/null +++ b/apps/events-helsinki/sonar-project.properties @@ -0,0 +1,5 @@ +sonar.projectKey = City-of-Helsinki_tapahtumat-ui +sonar.organization = city-of-helsinki +sonar.exclusions = **/__tests__/**,**/browser-tests/** +sonar.sources = src +sonar.javascript.lcov.reportPaths = coverage/lcov.info \ No newline at end of file diff --git a/apps/sports-helsinki/sonar-project.properties b/apps/sports-helsinki/sonar-project.properties new file mode 100644 index 000000000..a8a2f64a0 --- /dev/null +++ b/apps/sports-helsinki/sonar-project.properties @@ -0,0 +1,5 @@ +sonar.projectKey = City-of-Helsinki_liikunta-ui +sonar.organization = city-of-helsinki +sonar.exclusions = **/__tests__/**,**/browser-tests/** +sonar.sources = src +sonar.javascript.lcov.reportPaths = coverage/lcov.info \ No newline at end of file From b6be31ccfb11690b8e354cb3c4ac5e10c83ee51c Mon Sep 17 00:00:00 2001 From: Tero Virtanen Date: Thu, 26 Jun 2025 09:09:23 +0300 Subject: [PATCH 04/19] build: ci-hobbies-helsinki uses reusable workflow --- .../workflows/ci-hobbies-helsinki-check.yml | 261 ++++++++++-------- apps/events-helsinki/package.json | 1 + apps/hobbies-helsinki/package.json | 1 + apps/sports-helsinki/package.json | 1 + 4 files changed, 147 insertions(+), 117 deletions(-) diff --git a/.github/workflows/ci-hobbies-helsinki-check.yml b/.github/workflows/ci-hobbies-helsinki-check.yml index 43ed53251..7e1460f51 100644 --- a/.github/workflows/ci-hobbies-helsinki-check.yml +++ b/.github/workflows/ci-hobbies-helsinki-check.yml @@ -2,9 +2,7 @@ name: CI-Hobbies-Helsinki on: push: - branches: - - dev - - main + branches: [main] # Only consider those paths to trigger the action paths: - 'apps/hobbies-helsinki/**' @@ -16,10 +14,7 @@ on: - '.github/workflows/**' pull_request: - types: - - opened - - synchronize - - reopened + branches: [main] # Only consider those paths to trigger the action paths: - 'apps/hobbies-helsinki/**' @@ -31,119 +26,151 @@ on: - '.github/workflows/**' env: - CI: true FEDERATION_ROUTER_ENDPOINT: https://events-graphql-federation-hobbies.test.hel.ninja/ CMS_ORIGIN: https://harrastus.app-staging.hkih.hion.dev LINKEDEVENTS_EVENT_ENDPOINT: https://api.hel.fi/linkedevents/v1/event jobs: - build: - name: Lint and build - runs-on: ubuntu-latest - strategy: - matrix: - node-version: [20.x] - steps: - - uses: actions/checkout@v4 - - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} - cache: 'yarn' - - - name: Install dependencies - run: | - yarn install --immutable --inline-builds - env: - HUSKY: 0 - - - name: Build web-app - working-directory: apps/hobbies-helsinki - run: | - yarn build - env: - # Speed up build: they are linted in a previous step - NEXTJS_IGNORE_ESLINT: true - # Speed up build: they are typechecked in a previous step - NEXTJS_IGNORE_TYPECHECK: true - # Speed up build: don't run if not needed, enable if it becomes needed - NEXT_DISABLE_SOURCEMAPS: true - # Don't send telemetry for ci - NEXT_TELEMETRY_DISABLED: true - # To allow checking size-limits - NEXTJS_DISABLE_SENTRY: false - # Fully disable sentry upload - NEXTJS_SENTRY_UPLOAD_DRY_RUN: true - FEDERATION_ROUTER_ENDPOINT: ${{env.FEDERATION_ROUTER_ENDPOINT}} - CMS_ORIGIN: ${{env.CMS_ORIGIN}} - LINKEDEVENTS_EVENT_ENDPOINT: ${{env.LINKEDEVENTS_EVENT_ENDPOINT}} - # Mock origin - NEXT_PUBLIC_APP_ORIGIN: https://localhost:3001 - NEXT_PUBLIC_MATOMO_URL_BASE: '//webanalytics.digiaiiris.com/js/' - NEXT_PUBLIC_MATOMO_SITE_ID: 939 - NEXT_PUBLIC_MATOMO_SRC_URL: 'piwik.min.js' - NEXT_PUBLIC_MATOMO_TRACKER_URL: 'tracker.php' - NEXT_PUBLIC_MATOMO_ENABLED: 0 - - - name: Check browser bundle size limits - working-directory: apps/hobbies-helsinki - run: | - yarn check-size - - - name: Check ecmascript checks for build files - working-directory: apps/hobbies-helsinki - run: | - yarn check-dist - - test: - name: Test - runs-on: ubuntu-latest - strategy: - matrix: - node-version: [20.x] - steps: - - uses: actions/checkout@v4 - - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} - cache: 'yarn' - - - name: Install dependencies - run: | - yarn install --immutable --inline-builds - env: - HUSKY: 0 - - - name: Typecheck - working-directory: apps/hobbies-helsinki - run: | - yarn typecheck - - - name: Linter - working-directory: apps/hobbies-helsinki - run: | - yarn lint - - - name: Unit tests - working-directory: apps/hobbies-helsinki - run: | - yarn test --coverage - env: - TZ: Europe/Helsinki - FEDERATION_ROUTER_ENDPOINT: ${{env.FEDERATION_ROUTER_ENDPOINT}} - CMS_ORIGIN: ${{env.CMS_ORIGIN}} - LINKEDEVENTS_EVENT_ENDPOINT: ${{env.LINKEDEVENTS_EVENT_ENDPOINT}} - # Mock origin - NEXT_PUBLIC_APP_ORIGIN: https://localhost:3001 - - - name: SonarQube Cloud Scan - uses: SonarSource/sonarqube-scan-action@v5.1.0 - with: - projectBaseDir: apps/hobbies-helsinki - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + common: + uses: City-of-Helsinki/.github/.github/workflows/ci-node.yml@ci_node_parameters + secrets: inherit + with: + node-version: 20 + typecheck: true + app-directory: apps/hobbies-helsinki + extra-commands: | + echo "ENABLE_ADMIN_APP=true" >> $GITHUB_ENV + echo "ENABLE_REDIRECT_APP=true" >> $GITHUB_ENV + # Speed up build: they are linted in a previous step + echo "NEXTJS_IGNORE_ESLINT=true" >> $GITHUB_ENV + # Speed up build: they are typechecked in a previous step + echo "NEXTJS_IGNORE_TYPECHECK=true" >> $GITHUB_ENV + # Speed up build: don't run if not needed, enable if it becomes needed + echo "NEXT_DISABLE_SOURCEMAPS=true" >> $GITHUB_ENV + # Don't send telemetry for ci + echo "NEXT_TELEMETRY_DISABLED=true" >> $GITHUB_ENV + # To allow checking size-limits + echo "NEXTJS_DISABLE_SENTRY=false" >> $GITHUB_ENV + # Fully disable sentry upload + echo "NEXTJS_SENTRY_UPLOAD_DRY_RUN=true" >> $GITHUB_ENV + echo "FEDERATION_ROUTER_ENDPOINT=${{env.FEDERATION_ROUTER_ENDPOINT}}" >> $GITHUB_ENV + echo "CMS_ORIGIN=${{env.CMS_ORIGIN}}" >> $GITHUB_ENV + echo "LINKEDEVENTS_EVENT_ENDPOINT=${{env.LINKEDEVENTS_EVENT_ENDPOINT}}" >> $GITHUB_ENV + # Mock origin + echo "NEXT_PUBLIC_APP_ORIGIN=https://localhost:3001" >> $GITHUB_ENV + echo "NEXT_PUBLIC_MATOMO_URL_BASE=//webanalytics.digiaiiris.com/js/" >> $GITHUB_ENV + echo "NEXT_PUBLIC_MATOMO_SITE_ID=939" >> $GITHUB_ENV + echo "NEXT_PUBLIC_MATOMO_SRC_URL=piwik.min.js" >> $GITHUB_ENV + echo "NEXT_PUBLIC_MATOMO_TRACKER_URL=tracker.php" >> $GITHUB_ENV + echo "NEXT_PUBLIC_MATOMO_ENABLED=0" >> $GITHUB_ENV + + # build: + # name: Lint and build + # runs-on: ubuntu-latest + # strategy: + # matrix: + # node-version: [20.x] + # steps: + # - uses: actions/checkout@v4 + + # - name: Use Node.js ${{ matrix.node-version }} + # uses: actions/setup-node@v4 + # with: + # node-version: ${{ matrix.node-version }} + # cache: 'yarn' + + # - name: Install dependencies + # run: | + # yarn install --immutable --inline-builds + # env: + # HUSKY: 0 + + # - name: Build web-app + # working-directory: apps/hobbies-helsinki + # run: | + # yarn build + # env: + # # Speed up build: they are linted in a previous step + # NEXTJS_IGNORE_ESLINT: true + # # Speed up build: they are typechecked in a previous step + # NEXTJS_IGNORE_TYPECHECK: true + # # Speed up build: don't run if not needed, enable if it becomes needed + # NEXT_DISABLE_SOURCEMAPS: true + # # Don't send telemetry for ci + # NEXT_TELEMETRY_DISABLED: true + # # To allow checking size-limits + # NEXTJS_DISABLE_SENTRY: false + # # Fully disable sentry upload + # NEXTJS_SENTRY_UPLOAD_DRY_RUN: true + # FEDERATION_ROUTER_ENDPOINT: ${{env.FEDERATION_ROUTER_ENDPOINT}} + # CMS_ORIGIN: ${{env.CMS_ORIGIN}} + # LINKEDEVENTS_EVENT_ENDPOINT: ${{env.LINKEDEVENTS_EVENT_ENDPOINT}} + # # Mock origin + # NEXT_PUBLIC_APP_ORIGIN: https://localhost:3001 + # NEXT_PUBLIC_MATOMO_URL_BASE: '//webanalytics.digiaiiris.com/js/' + # NEXT_PUBLIC_MATOMO_SITE_ID: 939 + # NEXT_PUBLIC_MATOMO_SRC_URL: 'piwik.min.js' + # NEXT_PUBLIC_MATOMO_TRACKER_URL: 'tracker.php' + # NEXT_PUBLIC_MATOMO_ENABLED: 0 + + # - name: Check browser bundle size limits + # working-directory: apps/hobbies-helsinki + # run: | + # yarn check-size + + # - name: Check ecmascript checks for build files + # working-directory: apps/hobbies-helsinki + # run: | + # yarn check-dist + + # test: + # name: Test + # runs-on: ubuntu-latest + # strategy: + # matrix: + # node-version: [20.x] + # steps: + # - uses: actions/checkout@v4 + + # - name: Use Node.js ${{ matrix.node-version }} + # uses: actions/setup-node@v4 + # with: + # node-version: ${{ matrix.node-version }} + # cache: 'yarn' + + # - name: Install dependencies + # run: | + # yarn install --immutable --inline-builds + # env: + # HUSKY: 0 + + # - name: Typecheck + # working-directory: apps/hobbies-helsinki + # run: | + # yarn typecheck + + # - name: Linter + # working-directory: apps/hobbies-helsinki + # run: | + # yarn lint + + # - name: Unit tests + # working-directory: apps/hobbies-helsinki + # run: | + # yarn test:coverage + # env: + # TZ: Europe/Helsinki + # FEDERATION_ROUTER_ENDPOINT: ${{env.FEDERATION_ROUTER_ENDPOINT}} + # CMS_ORIGIN: ${{env.CMS_ORIGIN}} + # LINKEDEVENTS_EVENT_ENDPOINT: ${{env.LINKEDEVENTS_EVENT_ENDPOINT}} + # # Mock origin + # NEXT_PUBLIC_APP_ORIGIN: https://localhost:3001 + + # - name: SonarQube Cloud Scan + # uses: SonarSource/sonarqube-scan-action@v5.1.0 + # with: + # projectBaseDir: apps/hobbies-helsinki + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/apps/events-helsinki/package.json b/apps/events-helsinki/package.json index ed5d98ef0..f48363c2d 100644 --- a/apps/events-helsinki/package.json +++ b/apps/events-helsinki/package.json @@ -20,6 +20,7 @@ "check-size": "size-limit --highlight-less", "typecheck": "tsc --project ./tsconfig.json --noEmit", "test": "jest", + "test:coverage": "jest --coverage", "lint": "eslint . --ext .ts,.tsx,.js,.jsx,.cjs,.mjs,.mdx,.graphql --cache --cache-location ../../.cache/eslint/events-helsinki.eslintcache", "lint-fix": "eslint . --ext .ts,.tsx,.js,.jsx,.cjs,.mjs,.mdx,.graphql --fix", "get-translations": "node ./scripts/get-translations.js", diff --git a/apps/hobbies-helsinki/package.json b/apps/hobbies-helsinki/package.json index 5a4880b1f..c6e3e252c 100644 --- a/apps/hobbies-helsinki/package.json +++ b/apps/hobbies-helsinki/package.json @@ -20,6 +20,7 @@ "check-size": "size-limit --highlight-less", "typecheck": "tsc --project ./tsconfig.json --noEmit", "test": "jest", + "test:coverage": "jest --coverage", "lint": "eslint . --ext .ts,.tsx,.js,.jsx,.cjs,.mjs,.mdx,.graphql --cache --cache-location ../../.cache/eslint/hobbies-helsinki.eslintcache", "lint-fix": "eslint . --ext .ts,.tsx,.js,.jsx,.cjs,.mjs,.mdx,.graphql --fix", "get-translations": "node ./scripts/get-translations.js", diff --git a/apps/sports-helsinki/package.json b/apps/sports-helsinki/package.json index 204bea3bf..fba109da4 100644 --- a/apps/sports-helsinki/package.json +++ b/apps/sports-helsinki/package.json @@ -21,6 +21,7 @@ "check-size": "size-limit --highlight-less", "typecheck": "tsc --project ./tsconfig.json --noEmit", "test": "jest", + "test:coverage": "jest --coverage", "lint": "eslint . --ext .ts,.tsx,.js,.jsx,.cjs,.mjs,.mdx,.graphql --cache --cache-location ../../.cache/eslint/sports-helsinki.eslintcache", "lint-fix": "eslint . --ext .ts,.tsx,.js,.jsx,.cjs,.mjs,.mdx,.graphql --fix", "get-translations": "node ./scripts/get-translations.js", From 7c5aa8652263d8c7dadb8f75d3a8d563358437b2 Mon Sep 17 00:00:00 2001 From: Tero Virtanen Date: Thu, 26 Jun 2025 09:33:52 +0300 Subject: [PATCH 05/19] build: ci hobbies env variables --- .github/workflows/ci-hobbies-helsinki-check.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-hobbies-helsinki-check.yml b/.github/workflows/ci-hobbies-helsinki-check.yml index 7e1460f51..b6842326d 100644 --- a/.github/workflows/ci-hobbies-helsinki-check.yml +++ b/.github/workflows/ci-hobbies-helsinki-check.yml @@ -24,11 +24,12 @@ on: - 'tsconfig.base.json' - '.prettier*' - '.github/workflows/**' + workflow_dispatch: env: - FEDERATION_ROUTER_ENDPOINT: https://events-graphql-federation-hobbies.test.hel.ninja/ - CMS_ORIGIN: https://harrastus.app-staging.hkih.hion.dev - LINKEDEVENTS_EVENT_ENDPOINT: https://api.hel.fi/linkedevents/v1/event + env_federation_router_endpoint: https://events-graphql-federation-hobbies.test.hel.ninja/ + env_cms_origin: https://harrastus.app-staging.hkih.hion.dev + env_linkedevents_event_endpoint: https://api.hel.fi/linkedevents/v1/event jobs: common: @@ -53,9 +54,9 @@ jobs: echo "NEXTJS_DISABLE_SENTRY=false" >> $GITHUB_ENV # Fully disable sentry upload echo "NEXTJS_SENTRY_UPLOAD_DRY_RUN=true" >> $GITHUB_ENV - echo "FEDERATION_ROUTER_ENDPOINT=${{env.FEDERATION_ROUTER_ENDPOINT}}" >> $GITHUB_ENV - echo "CMS_ORIGIN=${{env.CMS_ORIGIN}}" >> $GITHUB_ENV - echo "LINKEDEVENTS_EVENT_ENDPOINT=${{env.LINKEDEVENTS_EVENT_ENDPOINT}}" >> $GITHUB_ENV + echo "FEDERATION_ROUTER_ENDPOINT=$env_federation_router_endpoint" >> $GITHUB_ENV + echo "CMS_ORIGIN=$env_cms_origin" >> $GITHUB_ENV + echo "LINKEDEVENTS_EVENT_ENDPOINT=$env_linkedevents_event_endpoint" >> $GITHUB_ENV # Mock origin echo "NEXT_PUBLIC_APP_ORIGIN=https://localhost:3001" >> $GITHUB_ENV echo "NEXT_PUBLIC_MATOMO_URL_BASE=//webanalytics.digiaiiris.com/js/" >> $GITHUB_ENV From 3a11bd76eb350d3b0ef8245b5f0e3813f72c79db Mon Sep 17 00:00:00 2001 From: Tero Virtanen Date: Thu, 26 Jun 2025 10:16:41 +0300 Subject: [PATCH 06/19] build: not use env vars --- .github/workflows/ci-hobbies-helsinki-check.yml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci-hobbies-helsinki-check.yml b/.github/workflows/ci-hobbies-helsinki-check.yml index b6842326d..e81b84af7 100644 --- a/.github/workflows/ci-hobbies-helsinki-check.yml +++ b/.github/workflows/ci-hobbies-helsinki-check.yml @@ -26,11 +26,6 @@ on: - '.github/workflows/**' workflow_dispatch: -env: - env_federation_router_endpoint: https://events-graphql-federation-hobbies.test.hel.ninja/ - env_cms_origin: https://harrastus.app-staging.hkih.hion.dev - env_linkedevents_event_endpoint: https://api.hel.fi/linkedevents/v1/event - jobs: common: uses: City-of-Helsinki/.github/.github/workflows/ci-node.yml@ci_node_parameters @@ -54,9 +49,9 @@ jobs: echo "NEXTJS_DISABLE_SENTRY=false" >> $GITHUB_ENV # Fully disable sentry upload echo "NEXTJS_SENTRY_UPLOAD_DRY_RUN=true" >> $GITHUB_ENV - echo "FEDERATION_ROUTER_ENDPOINT=$env_federation_router_endpoint" >> $GITHUB_ENV - echo "CMS_ORIGIN=$env_cms_origin" >> $GITHUB_ENV - echo "LINKEDEVENTS_EVENT_ENDPOINT=$env_linkedevents_event_endpoint" >> $GITHUB_ENV + echo "FEDERATION_ROUTER_ENDPOINT=https://events-graphql-federation-hobbies.test.hel.ninja/" >> $GITHUB_ENV + echo "CMS_ORIGIN=https://harrastus.app-staging.hkih.hion.dev" >> $GITHUB_ENV + echo "LINKEDEVENTS_EVENT_ENDPOINT=https://api.hel.fi/linkedevents/v1/event" >> $GITHUB_ENV # Mock origin echo "NEXT_PUBLIC_APP_ORIGIN=https://localhost:3001" >> $GITHUB_ENV echo "NEXT_PUBLIC_MATOMO_URL_BASE=//webanalytics.digiaiiris.com/js/" >> $GITHUB_ENV From 6ed85ecaaeed08493d605de58791f472ed773542 Mon Sep 17 00:00:00 2001 From: Tero Virtanen Date: Thu, 26 Jun 2025 12:52:06 +0300 Subject: [PATCH 07/19] build: apps ci workflows uses reusable workflow --- .../workflows/ci-events-helsinki-check.yml | 155 ++++------------- .../workflows/ci-hobbies-helsinki-check.yml | 115 +------------ .../workflows/ci-sports-helsinki-check.yml | 161 ++++-------------- 3 files changed, 70 insertions(+), 361 deletions(-) diff --git a/.github/workflows/ci-events-helsinki-check.yml b/.github/workflows/ci-events-helsinki-check.yml index cc1a34f59..946192b86 100644 --- a/.github/workflows/ci-events-helsinki-check.yml +++ b/.github/workflows/ci-events-helsinki-check.yml @@ -2,9 +2,7 @@ name: CI-Events-Helsinki on: push: - branches: - - dev - - main + branches: [main] # Only consider those paths to trigger the action paths: - 'apps/events-helsinki/**' @@ -16,10 +14,7 @@ on: - '.github/workflows/**' pull_request: - types: - - opened - - synchronize - - reopened + branches: [main] # Only consider those paths to trigger the action paths: - 'apps/events-helsinki/**' @@ -37,117 +32,35 @@ env: LINKEDEVENTS_EVENT_ENDPOINT: https://api.hel.fi/linkedevents/v1/event jobs: - test: - runs-on: ubuntu-latest - strategy: - matrix: - node-version: [20.x] - steps: - - uses: actions/checkout@v4 - - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} - - # Why not using setup-node 2.2+ cache option (yet) ? - # see https://github.com/belgattitude/nextjs-monorepo-example/pull/369 - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn config get cacheFolder)" - - - name: Restore yarn cache - uses: actions/cache@v4 - id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: yarn-cache-folder-${{ hashFiles('**/yarn.lock', '.yarnrc.yml') }} - restore-keys: | - yarn-cache-folder- - - # see https://github.com/vercel/next.js/pull/27362 - - name: Restore nextjs build events-helsinki from cache - uses: actions/cache@v4 - with: - path: | - ${{ github.workspace }}/apps/events-helsinki/.next/cache - ${{ github.workspace }}/.cache - ${{ github.workspace }}/**/tsconfig.tsbuildinfo - - key: ${{ runner.os }}-events-helsinki-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('apps/events-helsinki/src/**.[jt]sx?', 'apps/events-helsinki/src/**.json') }} - restore-keys: | - ${{ runner.os }}-events-helsinki-${{ hashFiles('**/yarn.lock') }}- - - - name: Install dependencies - run: | - yarn install --immutable --inline-builds - env: - HUSKY: 0 - - - name: Typecheck - working-directory: apps/events-helsinki - run: | - yarn typecheck - - - name: Linter - working-directory: apps/events-helsinki - run: | - yarn lint - - - name: Unit tests - working-directory: apps/events-helsinki - run: | - yarn test --coverage - env: - TZ: Europe/Helsinki - FEDERATION_ROUTER_ENDPOINT: ${{env.FEDERATION_ROUTER_ENDPOINT}} - CMS_ORIGIN: ${{env.CMS_ORIGIN}} - LINKEDEVENTS_EVENT_ENDPOINT: ${{env.LINKEDEVENTS_EVENT_ENDPOINT}} - # Mock origin - NEXT_PUBLIC_APP_ORIGIN: https://localhost:3001 - - - name: SonarQube Cloud Scan - uses: SonarSource/sonarqube-scan-action@v5.1.0 - with: - projectBaseDir: apps/events-helsinki - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - - - name: Build web-app - working-directory: apps/events-helsinki - run: | - yarn build - env: - # Speed up build: they are linted in a previous step - NEXTJS_IGNORE_ESLINT: true - # Speed up build: they are typechecked in a previous step - NEXTJS_IGNORE_TYPECHECK: true - # Speed up build: don't run if not needed, enable if it becomes needed - NEXT_DISABLE_SOURCEMAPS: true - # Don't send telemetry for ci - NEXT_TELEMETRY_DISABLED: true - # To allow checking size-limits - NEXTJS_DISABLE_SENTRY: false - # Fully disable sentry upload - NEXTJS_SENTRY_UPLOAD_DRY_RUN: true - FEDERATION_ROUTER_ENDPOINT: ${{env.FEDERATION_ROUTER_ENDPOINT}} - CMS_ORIGIN: ${{env.CMS_ORIGIN}} - LINKEDEVENTS_EVENT_ENDPOINT: ${{env.LINKEDEVENTS_EVENT_ENDPOINT}} - # Mock origin - NEXT_PUBLIC_APP_ORIGIN: https://localhost:3001 - NEXT_PUBLIC_MATOMO_URL_BASE: '//webanalytics.digiaiiris.com/js/' - NEXT_PUBLIC_MATOMO_SITE_ID: 708 - NEXT_PUBLIC_MATOMO_SRC_URL: 'piwik.min.js' - NEXT_PUBLIC_MATOMO_TRACKER_URL: 'tracker.php' - NEXT_PUBLIC_MATOMO_ENABLED: 0 - - - name: Check browser bundle size limits - working-directory: apps/events-helsinki - run: | - yarn check-size - - - name: Check ecmascript checks for build files - working-directory: apps/events-helsinki - run: | - yarn check-dist + common: + uses: City-of-Helsinki/.github/.github/workflows/ci-node.yml@ci_node_parameters + secrets: inherit + with: + node-version: 20 + typecheck: true + app-directory: apps/events-helsinki + extra-commands: | + # Timezone for tests + echo "TZ=Europe/Helsinki" >> $GITHUB_ENV + # Speed up build: they are linted in a previous step + echo "NEXTJS_IGNORE_ESLINT=true" >> $GITHUB_ENV + # Speed up build: they are typechecked in a previous step + echo "NEXTJS_IGNORE_TYPECHECK=true" >> $GITHUB_ENV + # Speed up build: don't run if not needed, enable if it becomes needed + echo "NEXT_DISABLE_SOURCEMAPS=true" >> $GITHUB_ENV + # Don't send telemetry for ci + echo "NEXT_TELEMETRY_DISABLED=true" >> $GITHUB_ENV + # To allow checking size-limits + echo "NEXTJS_DISABLE_SENTRY=false" >> $GITHUB_ENV + # Fully disable sentry upload + echo "NEXTJS_SENTRY_UPLOAD_DRY_RUN=true" >> $GITHUB_ENV + echo "FEDERATION_ROUTER_ENDPOINT=https://events-graphql-federation-events.test.hel.ninja/" >> $GITHUB_ENV + echo "CMS_ORIGIN=https://tapahtumat.app-staging.hkih.hion.dev" >> $GITHUB_ENV + echo "LINKEDEVENTS_EVENT_ENDPOINT=https://api.hel.fi/linkedevents/v1/event" >> $GITHUB_ENV + # Mock origin + echo "NEXT_PUBLIC_APP_ORIGIN=https://localhost:3001" >> $GITHUB_ENV + echo "NEXT_PUBLIC_MATOMO_URL_BASE=//webanalytics.digiaiiris.com/js/" >> $GITHUB_ENV + echo "NEXT_PUBLIC_MATOMO_SITE_ID=708" >> $GITHUB_ENV + echo "NEXT_PUBLIC_MATOMO_SRC_URL=piwik.min.js" >> $GITHUB_ENV + echo "NEXT_PUBLIC_MATOMO_TRACKER_URL=tracker.php" >> $GITHUB_ENV + echo "NEXT_PUBLIC_MATOMO_ENABLED=0" >> $GITHUB_ENV diff --git a/.github/workflows/ci-hobbies-helsinki-check.yml b/.github/workflows/ci-hobbies-helsinki-check.yml index e81b84af7..aaa6ada29 100644 --- a/.github/workflows/ci-hobbies-helsinki-check.yml +++ b/.github/workflows/ci-hobbies-helsinki-check.yml @@ -35,8 +35,8 @@ jobs: typecheck: true app-directory: apps/hobbies-helsinki extra-commands: | - echo "ENABLE_ADMIN_APP=true" >> $GITHUB_ENV - echo "ENABLE_REDIRECT_APP=true" >> $GITHUB_ENV + # Timezone for tests + echo "TZ=Europe/Helsinki" >> $GITHUB_ENV # Speed up build: they are linted in a previous step echo "NEXTJS_IGNORE_ESLINT=true" >> $GITHUB_ENV # Speed up build: they are typechecked in a previous step @@ -59,114 +59,3 @@ jobs: echo "NEXT_PUBLIC_MATOMO_SRC_URL=piwik.min.js" >> $GITHUB_ENV echo "NEXT_PUBLIC_MATOMO_TRACKER_URL=tracker.php" >> $GITHUB_ENV echo "NEXT_PUBLIC_MATOMO_ENABLED=0" >> $GITHUB_ENV - - # build: - # name: Lint and build - # runs-on: ubuntu-latest - # strategy: - # matrix: - # node-version: [20.x] - # steps: - # - uses: actions/checkout@v4 - - # - name: Use Node.js ${{ matrix.node-version }} - # uses: actions/setup-node@v4 - # with: - # node-version: ${{ matrix.node-version }} - # cache: 'yarn' - - # - name: Install dependencies - # run: | - # yarn install --immutable --inline-builds - # env: - # HUSKY: 0 - - # - name: Build web-app - # working-directory: apps/hobbies-helsinki - # run: | - # yarn build - # env: - # # Speed up build: they are linted in a previous step - # NEXTJS_IGNORE_ESLINT: true - # # Speed up build: they are typechecked in a previous step - # NEXTJS_IGNORE_TYPECHECK: true - # # Speed up build: don't run if not needed, enable if it becomes needed - # NEXT_DISABLE_SOURCEMAPS: true - # # Don't send telemetry for ci - # NEXT_TELEMETRY_DISABLED: true - # # To allow checking size-limits - # NEXTJS_DISABLE_SENTRY: false - # # Fully disable sentry upload - # NEXTJS_SENTRY_UPLOAD_DRY_RUN: true - # FEDERATION_ROUTER_ENDPOINT: ${{env.FEDERATION_ROUTER_ENDPOINT}} - # CMS_ORIGIN: ${{env.CMS_ORIGIN}} - # LINKEDEVENTS_EVENT_ENDPOINT: ${{env.LINKEDEVENTS_EVENT_ENDPOINT}} - # # Mock origin - # NEXT_PUBLIC_APP_ORIGIN: https://localhost:3001 - # NEXT_PUBLIC_MATOMO_URL_BASE: '//webanalytics.digiaiiris.com/js/' - # NEXT_PUBLIC_MATOMO_SITE_ID: 939 - # NEXT_PUBLIC_MATOMO_SRC_URL: 'piwik.min.js' - # NEXT_PUBLIC_MATOMO_TRACKER_URL: 'tracker.php' - # NEXT_PUBLIC_MATOMO_ENABLED: 0 - - # - name: Check browser bundle size limits - # working-directory: apps/hobbies-helsinki - # run: | - # yarn check-size - - # - name: Check ecmascript checks for build files - # working-directory: apps/hobbies-helsinki - # run: | - # yarn check-dist - - # test: - # name: Test - # runs-on: ubuntu-latest - # strategy: - # matrix: - # node-version: [20.x] - # steps: - # - uses: actions/checkout@v4 - - # - name: Use Node.js ${{ matrix.node-version }} - # uses: actions/setup-node@v4 - # with: - # node-version: ${{ matrix.node-version }} - # cache: 'yarn' - - # - name: Install dependencies - # run: | - # yarn install --immutable --inline-builds - # env: - # HUSKY: 0 - - # - name: Typecheck - # working-directory: apps/hobbies-helsinki - # run: | - # yarn typecheck - - # - name: Linter - # working-directory: apps/hobbies-helsinki - # run: | - # yarn lint - - # - name: Unit tests - # working-directory: apps/hobbies-helsinki - # run: | - # yarn test:coverage - # env: - # TZ: Europe/Helsinki - # FEDERATION_ROUTER_ENDPOINT: ${{env.FEDERATION_ROUTER_ENDPOINT}} - # CMS_ORIGIN: ${{env.CMS_ORIGIN}} - # LINKEDEVENTS_EVENT_ENDPOINT: ${{env.LINKEDEVENTS_EVENT_ENDPOINT}} - # # Mock origin - # NEXT_PUBLIC_APP_ORIGIN: https://localhost:3001 - - # - name: SonarQube Cloud Scan - # uses: SonarSource/sonarqube-scan-action@v5.1.0 - # with: - # projectBaseDir: apps/hobbies-helsinki - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - diff --git a/.github/workflows/ci-sports-helsinki-check.yml b/.github/workflows/ci-sports-helsinki-check.yml index bccda558b..3ccbb20be 100644 --- a/.github/workflows/ci-sports-helsinki-check.yml +++ b/.github/workflows/ci-sports-helsinki-check.yml @@ -2,9 +2,7 @@ name: CI-Sports-Helsinki on: push: - branches: - - dev - - main + branches: [main] # Only consider those paths to trigger the action paths: - 'apps/sports-helsinki/**' @@ -16,10 +14,7 @@ on: - '.github/workflows/**' pull_request: - types: - - opened - - synchronize - - reopened + branches: [main] # Only consider those paths to trigger the action paths: - 'apps/sports-helsinki/**' @@ -30,124 +25,36 @@ on: - '.prettier*' - '.github/workflows/**' -env: - CI: true - FEDERATION_ROUTER_ENDPOINT: https://events-graphql-federation-sports.test.hel.ninja/ - CMS_ORIGIN: https://liikunta.app-staging.hkih.hion.dev - LINKEDEVENTS_EVENT_ENDPOINT: https://api.hel.fi/linkedevents/v1/event - jobs: - test: - runs-on: ubuntu-latest - strategy: - matrix: - node-version: [20.x] - steps: - - uses: actions/checkout@v4 - - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} - - # Why not using setup-node 2.2+ cache option (yet) ? - # see https://github.com/belgattitude/nextjs-monorepo-example/pull/369 - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn config get cacheFolder)" - - - name: Restore yarn cache - uses: actions/cache@v4 - id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: yarn-cache-folder-${{ hashFiles('**/yarn.lock', '.yarnrc.yml') }} - restore-keys: | - yarn-cache-folder- - - # see https://github.com/vercel/next.js/pull/27362 - - name: Restore nextjs build sports-helsinki from cache - uses: actions/cache@v4 - with: - path: | - ${{ github.workspace }}/apps/sports-helsinki/.next/cache - ${{ github.workspace }}/.cache - ${{ github.workspace }}/**/tsconfig.tsbuildinfo - - key: ${{ runner.os }}-sports-helsinki-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('apps/sports-helsinki/src/**.[jt]sx?', 'apps/sports-helsinki/src/**.json') }} - restore-keys: | - ${{ runner.os }}-sports-helsinki-${{ hashFiles('**/yarn.lock') }}- - - - name: Install dependencies - run: | - yarn install --immutable --inline-builds - env: - HUSKY: 0 - - - name: Typecheck - working-directory: apps/sports-helsinki - run: | - yarn typecheck - - - name: Linter - working-directory: apps/sports-helsinki - run: | - yarn lint - - - name: Unit tests - working-directory: apps/sports-helsinki - run: | - yarn test --coverage - env: - TZ: Europe/Helsinki - FEDERATION_ROUTER_ENDPOINT: ${{env.FEDERATION_ROUTER_ENDPOINT}} - CMS_ORIGIN: ${{env.CMS_ORIGIN}} - LINKEDEVENTS_EVENT_ENDPOINT: ${{env.LINKEDEVENTS_EVENT_ENDPOINT}} - # Mock origin - NEXT_PUBLIC_APP_ORIGIN: https://localhost:3001 - - - name: SonarQube Cloud Scan - uses: SonarSource/sonarqube-scan-action@v5.1.0 - with: - projectBaseDir: apps/sports-helsinki - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - - - name: Build web-app - working-directory: apps/sports-helsinki - run: | - yarn build - env: - # Speed up build: they are linted in a previous step - NEXTJS_IGNORE_ESLINT: true - # Speed up build: they are typechecked in a previous step - NEXTJS_IGNORE_TYPECHECK: true - # Speed up build: don't run if not needed, enable if it becomes needed - NEXT_DISABLE_SOURCEMAPS: true - # Don't send telemetry for ci - NEXT_TELEMETRY_DISABLED: true - # To allow checking size-limits - NEXTJS_DISABLE_SENTRY: false - # Fully disable sentry upload - NEXTJS_SENTRY_UPLOAD_DRY_RUN: true - FEDERATION_ROUTER_ENDPOINT: ${{env.FEDERATION_ROUTER_ENDPOINT}} - CMS_ORIGIN: ${{env.CMS_ORIGIN}} - LINKEDEVENTS_EVENT_ENDPOINT: ${{env.LINKEDEVENTS_EVENT_ENDPOINT}} - # Mock origin - NEXT_PUBLIC_APP_ORIGIN: https://localhost:3001 - NEXT_PUBLIC_MATOMO_URL_BASE: '//webanalytics.digiaiiris.com/js/' - NEXT_PUBLIC_MATOMO_SITE_ID: 939 - NEXT_PUBLIC_MATOMO_SRC_URL: 'piwik.min.js' - NEXT_PUBLIC_MATOMO_TRACKER_URL: 'tracker.php' - NEXT_PUBLIC_MATOMO_ENABLED: 0 - - - name: Check browser bundle size limits - working-directory: apps/sports-helsinki - run: | - yarn check-size - - - name: Check ecmascript checks for build files - working-directory: apps/sports-helsinki - run: | - yarn check-dist + common: + uses: City-of-Helsinki/.github/.github/workflows/ci-node.yml@ci_node_parameters + secrets: inherit + with: + node-version: 20 + typecheck: true + app-directory: apps/sports-helsinki + extra-commands: | + # Timezone for tests + echo "TZ=Europe/Helsinki" >> $GITHUB_ENV + # Speed up build: they are linted in a previous step + echo "NEXTJS_IGNORE_ESLINT=true" >> $GITHUB_ENV + # Speed up build: they are typechecked in a previous step + echo "NEXTJS_IGNORE_TYPECHECK=true" >> $GITHUB_ENV + # Speed up build: don't run if not needed, enable if it becomes needed + echo "NEXT_DISABLE_SOURCEMAPS=true" >> $GITHUB_ENV + # Don't send telemetry for ci + echo "NEXT_TELEMETRY_DISABLED=true" >> $GITHUB_ENV + # To allow checking size-limits + echo "NEXTJS_DISABLE_SENTRY=false" >> $GITHUB_ENV + # Fully disable sentry upload + echo "NEXTJS_SENTRY_UPLOAD_DRY_RUN=true" >> $GITHUB_ENV + echo "FEDERATION_ROUTER_ENDPOINT=https://events-graphql-federation-sports.test.hel.ninja/" >> $GITHUB_ENV + echo "CMS_ORIGIN=https://liikunta.app-staging.hkih.hion.dev" >> $GITHUB_ENV + echo "LINKEDEVENTS_EVENT_ENDPOINT=https://api.hel.fi/linkedevents/v1/event" >> $GITHUB_ENV + # Mock origin + echo "NEXT_PUBLIC_APP_ORIGIN=https://localhost:3001" >> $GITHUB_ENV + echo "NEXT_PUBLIC_MATOMO_URL_BASE=//webanalytics.digiaiiris.com/js/" >> $GITHUB_ENV + echo "NEXT_PUBLIC_MATOMO_SITE_ID=939" >> $GITHUB_ENV + echo "NEXT_PUBLIC_MATOMO_SRC_URL=piwik.min.js" >> $GITHUB_ENV + echo "NEXT_PUBLIC_MATOMO_TRACKER_URL=tracker.php" >> $GITHUB_ENV + echo "NEXT_PUBLIC_MATOMO_ENABLED=0" >> $GITHUB_ENV From 357da2447d12880e53a99c2c1559c6fa1f8daa48 Mon Sep 17 00:00:00 2001 From: Tero Virtanen Date: Thu, 26 Jun 2025 13:28:03 +0300 Subject: [PATCH 08/19] build: proxies ci workflows --- .../ci-events-graphql-proxy-check.yml | 42 ++++++++ .../ci-venue-graphql-proxy-check.yml | 102 ++++-------------- proxies/events-graphql-proxy/package.json | 1 + .../sonar-project.properties | 5 + proxies/venue-graphql-proxy/package.json | 1 + .../sonar-project.properties | 5 + 6 files changed, 74 insertions(+), 82 deletions(-) create mode 100644 .github/workflows/ci-events-graphql-proxy-check.yml create mode 100644 proxies/events-graphql-proxy/sonar-project.properties create mode 100644 proxies/venue-graphql-proxy/sonar-project.properties diff --git a/.github/workflows/ci-events-graphql-proxy-check.yml b/.github/workflows/ci-events-graphql-proxy-check.yml new file mode 100644 index 000000000..ada31d2e8 --- /dev/null +++ b/.github/workflows/ci-events-graphql-proxy-check.yml @@ -0,0 +1,42 @@ +name: Events Graphql Proxy check + +on: + push: + branches: [main] + # Only consider those paths to trigger the action + paths: + - 'proxies/events-graphql-proxy/**' + - '.yarnrc.yml' + - 'tsconfig.base.json' + - '.prettier*' + - '.github/workflows/**' + + pull_request: + branches: [main] + # Only consider those paths to trigger the action + paths: + - 'proxies/events-graphql-proxy/**' + - '.yarnrc.yml' + - 'tsconfig.base.json' + - '.prettier*' + - '.github/workflows/**' + workflow_dispatch: + +jobs: + common: + uses: City-of-Helsinki/.github/.github/workflows/ci-node.yml@ci_node_parameters + secrets: inherit + with: + node-version: 20 + typecheck: true + app-directory: proxies/events-graphql-proxy + extra-commands: | + echo "NODE_ENV=production" >> $GITHUB_ENV + echo "GRAPHQL_PROXY_DEBUG=debug" >> $GITHUB_ENV + echo "GRAPHQL_PROXY_PORT=4100" >> $GITHUB_ENV + echo "GRAPHQL_PROXY_SENTRY_ENVIRONMENT=local" >> $GITHUB_ENV + echo "GRAPHQL_PROXY_DISABLE_WINSTON_LOGGING=0" >> $GITHUB_ENV + echo "GRAPHQL_PROXY_INTROSPECTION=1" >> $GITHUB_ENV + # events proxy only + echo "GRAPHQL_PROXY_MAP_OPEN_DATA_API_BASE_URL=https://kartta.hel.fi/ws/geoserver/avoindata" >> $GITHUB_ENV + echo "GRAPHQL_PROXY_API_BASE_URL=https://api.hel.fi/linkedevents/v1/" >> $GITHUB_ENV diff --git a/.github/workflows/ci-venue-graphql-proxy-check.yml b/.github/workflows/ci-venue-graphql-proxy-check.yml index ab40b326a..fa24d7bea 100644 --- a/.github/workflows/ci-venue-graphql-proxy-check.yml +++ b/.github/workflows/ci-venue-graphql-proxy-check.yml @@ -2,9 +2,7 @@ name: Venue Graphql Proxy check on: push: - branches: - - dev - - main + branches: [main] # Only consider those paths to trigger the action paths: - 'proxies/venue-graphql-proxy/**' @@ -14,10 +12,7 @@ on: - '.github/workflows/**' pull_request: - types: - - opened - - synchronize - - reopened + branches: [main] # Only consider those paths to trigger the action paths: - 'proxies/venue-graphql-proxy/**' @@ -25,80 +20,23 @@ on: - 'tsconfig.base.json' - '.prettier*' - '.github/workflows/**' - -env: - NODE_ENV: development - GRAPHQL_PROXY_DEBUG: debug - GRAPHQL_PROXY_PORT: 4100 - GRAPHQL_PROXY_API_BASE_URL: https://api.hel.fi - GRAPHQL_PROXY_MAP_OPEN_DATA_API_BASE_URL: https://kartta.hel.fi/ws/geoserver/avoindata - GRAPHQL_PROXY_SENTRY_DSN: - GRAPHQL_PROXY_SENTRY_ENVIRONMENT: local + workflow_dispatch: jobs: - test: - runs-on: ubuntu-latest - strategy: - matrix: - node-version: [16.x] - steps: - - uses: actions/checkout@v4 - - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} - - # Why not using setup-node 2.2+ cache option (yet) ? - # see https://github.com/belgattitude/nextjs-monorepo-example/pull/369 - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn config get cacheFolder)" - - - name: Restore yarn cache - uses: actions/cache@v4 - id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: yarn-cache-folder-${{ hashFiles('**/yarn.lock', '.yarnrc.yml') }} - restore-keys: | - yarn-cache-folder- - - - name: Install dependencies - run: | - yarn install --immutable --inline-builds - env: - HUSKY: 0 - - - name: Typecheck - working-directory: proxies/venue-graphql-proxy - run: | - yarn typecheck - - - name: Linter - working-directory: proxies/venue-graphql-proxy - run: | - yarn lint - - - name: Unit tests - working-directory: proxies/venue-graphql-proxy - run: | - yarn test --coverage - env: - TZ: Europe/Helsinki - NEXT_PUBLIC_FEDERATION_ROUTER_ENDPOINT: ${{env.NEXT_PUBLIC_FEDERATION_ROUTER_ENDPOINT}} - NEXT_PUBLIC_CMS_ORIGIN: ${{env.NEXT_PUBLIC_CMS_ORIGIN}} - # Mock origin - NEXT_PUBLIC_APP_ORIGIN: https://localhost:3001 - - - name: Build web-app - working-directory: proxies/venue-graphql-proxy - run: | - yarn build - - - name: Check ecmascript checks for build files - working-directory: proxies/venue-graphql-proxy - run: | - yarn check-dist - - name: Upload coverage report to Codecov - uses: codecov/codecov-action@v1 + common: + uses: City-of-Helsinki/.github/.github/workflows/ci-node.yml@ci_node_parameters + secrets: inherit + with: + node-version: 20 + typecheck: true + app-directory: proxies/venue-graphql-proxy + extra-commands: | + echo "NODE_ENV=production" >> $GITHUB_ENV + echo "GRAPHQL_PROXY_DEBUG=debug" >> $GITHUB_ENV + echo "GRAPHQL_PROXY_PORT=4100" >> $GITHUB_ENV + echo "GRAPHQL_PROXY_SENTRY_ENVIRONMENT=local" >> $GITHUB_ENV + echo "GRAPHQL_PROXY_DISABLE_WINSTON_LOGGING=0" >> $GITHUB_ENV + echo "GRAPHQL_PROXY_INTROSPECTION=1" >> $GITHUB_ENV + # events proxy only + echo "GRAPHQL_PROXY_MAP_OPEN_DATA_API_BASE_URL=https://kartta.hel.fi/ws/geoserver/avoindata" >> $GITHUB_ENV + echo "GRAPHQL_PROXY_API_BASE_URL=https://api.hel.fi/linkedevents/v1/" >> $GITHUB_ENV diff --git a/proxies/events-graphql-proxy/package.json b/proxies/events-graphql-proxy/package.json index 0beb4198f..14db5a4ac 100644 --- a/proxies/events-graphql-proxy/package.json +++ b/proxies/events-graphql-proxy/package.json @@ -9,6 +9,7 @@ "dev": "nodemon --exec 'ts-node' src/index.ts", "start": "node build -r dotenv-expand/config", "test": "jest", + "test:coverage": "jest --coverage", "prepare": "husky install", "pre-commit": "lint-fix", "lint": "eslint . --ext .ts,.tsx,.js,.jsx,.cjs,.mjs,.mdx,.graphql --cache --cache-location ../../.cache/eslint/events-graphql-proxy.eslintcache", diff --git a/proxies/events-graphql-proxy/sonar-project.properties b/proxies/events-graphql-proxy/sonar-project.properties new file mode 100644 index 000000000..ab83207fb --- /dev/null +++ b/proxies/events-graphql-proxy/sonar-project.properties @@ -0,0 +1,5 @@ +sonar.projectKey = City-of-Helsinki_events-graphql-proxy +sonar.organization = city-of-helsinki +sonar.exclusions = **/__tests__/**,**/browser-tests/** +sonar.sources = src +sonar.javascript.lcov.reportPaths = coverage/lcov.info \ No newline at end of file diff --git a/proxies/venue-graphql-proxy/package.json b/proxies/venue-graphql-proxy/package.json index 53ed2dba7..f604e9557 100644 --- a/proxies/venue-graphql-proxy/package.json +++ b/proxies/venue-graphql-proxy/package.json @@ -9,6 +9,7 @@ "dev": "nodemon --exec 'ts-node' src/index.ts", "start": "node build -r dotenv-expand/config", "test": "jest --passWithNoTests", + "test:coverage": "jest --passWithNoTests --coverage", "prepare": "husky install", "pre-commit": "lint-fix", "lint": "eslint . --ext .ts,.tsx,.js,.jsx,.cjs,.mjs,.mdx,.graphql --cache --cache-location ../../.cache/eslint/venue-graphql-proxy.eslintcache", diff --git a/proxies/venue-graphql-proxy/sonar-project.properties b/proxies/venue-graphql-proxy/sonar-project.properties new file mode 100644 index 000000000..a8ee49958 --- /dev/null +++ b/proxies/venue-graphql-proxy/sonar-project.properties @@ -0,0 +1,5 @@ +sonar.projectKey = City-of-Helsinki_venue-graphql-proxy +sonar.organization = city-of-helsinki +sonar.exclusions = **/__tests__/**,**/browser-tests/** +sonar.sources = src +sonar.javascript.lcov.reportPaths = coverage/lcov.info \ No newline at end of file From 634a4b41ec2f4fa2bac6cb92c21e03712d06bc36 Mon Sep 17 00:00:00 2001 From: Tero Virtanen Date: Thu, 26 Jun 2025 13:49:24 +0300 Subject: [PATCH 09/19] build: rename proxies CI workflows --- .github/workflows/ci-events-graphql-proxy-check.yml | 4 ++-- .github/workflows/ci-venue-graphql-proxy-check.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-events-graphql-proxy-check.yml b/.github/workflows/ci-events-graphql-proxy-check.yml index ada31d2e8..c30cedad8 100644 --- a/.github/workflows/ci-events-graphql-proxy-check.yml +++ b/.github/workflows/ci-events-graphql-proxy-check.yml @@ -1,4 +1,4 @@ -name: Events Graphql Proxy check +name: CI-Events-Graphql-Proxy on: push: @@ -32,7 +32,7 @@ jobs: app-directory: proxies/events-graphql-proxy extra-commands: | echo "NODE_ENV=production" >> $GITHUB_ENV - echo "GRAPHQL_PROXY_DEBUG=debug" >> $GITHUB_ENV + echo "GRAPHQL_PROXY_DEBUG=1" >> $GITHUB_ENV echo "GRAPHQL_PROXY_PORT=4100" >> $GITHUB_ENV echo "GRAPHQL_PROXY_SENTRY_ENVIRONMENT=local" >> $GITHUB_ENV echo "GRAPHQL_PROXY_DISABLE_WINSTON_LOGGING=0" >> $GITHUB_ENV diff --git a/.github/workflows/ci-venue-graphql-proxy-check.yml b/.github/workflows/ci-venue-graphql-proxy-check.yml index fa24d7bea..887e49425 100644 --- a/.github/workflows/ci-venue-graphql-proxy-check.yml +++ b/.github/workflows/ci-venue-graphql-proxy-check.yml @@ -1,4 +1,4 @@ -name: Venue Graphql Proxy check +name: CI-Venue-Graphql-Proxy on: push: From 5f4d4933553b5297bc50105ea6efe1cf582ca5c6 Mon Sep 17 00:00:00 2001 From: Tero Virtanen Date: Thu, 26 Jun 2025 14:44:08 +0300 Subject: [PATCH 10/19] build: evets proxy node_env development --- .github/workflows/ci-events-graphql-proxy-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-events-graphql-proxy-check.yml b/.github/workflows/ci-events-graphql-proxy-check.yml index c30cedad8..da9451050 100644 --- a/.github/workflows/ci-events-graphql-proxy-check.yml +++ b/.github/workflows/ci-events-graphql-proxy-check.yml @@ -31,7 +31,7 @@ jobs: typecheck: true app-directory: proxies/events-graphql-proxy extra-commands: | - echo "NODE_ENV=production" >> $GITHUB_ENV + echo "NODE_ENV=development" >> $GITHUB_ENV echo "GRAPHQL_PROXY_DEBUG=1" >> $GITHUB_ENV echo "GRAPHQL_PROXY_PORT=4100" >> $GITHUB_ENV echo "GRAPHQL_PROXY_SENTRY_ENVIRONMENT=local" >> $GITHUB_ENV From f32a9234dcbea058a9b905c878bc3ce6b3c21ec0 Mon Sep 17 00:00:00 2001 From: Tero Virtanen Date: Thu, 26 Jun 2025 14:59:55 +0300 Subject: [PATCH 11/19] build: a chagne to workflow directory does not trigger all workflows --- .github/workflows/ci-events-graphql-proxy-check.yml | 10 +++++----- .github/workflows/ci-events-helsinki-check.yml | 4 ++-- .github/workflows/ci-hobbies-helsinki-check.yml | 4 ++-- .github/workflows/ci-monorepo-integrity.yml | 4 ++-- .github/workflows/ci-packages.yml | 4 ++-- .github/workflows/ci-sports-helsinki-check.yml | 4 ++-- .github/workflows/ci-venue-graphql-proxy-check.yml | 4 ++-- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci-events-graphql-proxy-check.yml b/.github/workflows/ci-events-graphql-proxy-check.yml index da9451050..5ded713d7 100644 --- a/.github/workflows/ci-events-graphql-proxy-check.yml +++ b/.github/workflows/ci-events-graphql-proxy-check.yml @@ -9,7 +9,7 @@ on: - '.yarnrc.yml' - 'tsconfig.base.json' - '.prettier*' - - '.github/workflows/**' + - '.github/workflows/ci-events-graphql-proxy-check.yml' pull_request: branches: [main] @@ -19,7 +19,7 @@ on: - '.yarnrc.yml' - 'tsconfig.base.json' - '.prettier*' - - '.github/workflows/**' + - '.github/workflows/ci-events-graphql-proxy-check.yml' workflow_dispatch: jobs: @@ -27,15 +27,15 @@ jobs: uses: City-of-Helsinki/.github/.github/workflows/ci-node.yml@ci_node_parameters secrets: inherit with: - node-version: 20 + node-version: 16 typecheck: true app-directory: proxies/events-graphql-proxy extra-commands: | - echo "NODE_ENV=development" >> $GITHUB_ENV + echo "NODE_ENV=production" >> $GITHUB_ENV echo "GRAPHQL_PROXY_DEBUG=1" >> $GITHUB_ENV echo "GRAPHQL_PROXY_PORT=4100" >> $GITHUB_ENV echo "GRAPHQL_PROXY_SENTRY_ENVIRONMENT=local" >> $GITHUB_ENV - echo "GRAPHQL_PROXY_DISABLE_WINSTON_LOGGING=0" >> $GITHUB_ENV + echo "GRAPHQL_PROXY_DISABLE_WINSTON_LOGGING=1" >> $GITHUB_ENV echo "GRAPHQL_PROXY_INTROSPECTION=1" >> $GITHUB_ENV # events proxy only echo "GRAPHQL_PROXY_MAP_OPEN_DATA_API_BASE_URL=https://kartta.hel.fi/ws/geoserver/avoindata" >> $GITHUB_ENV diff --git a/.github/workflows/ci-events-helsinki-check.yml b/.github/workflows/ci-events-helsinki-check.yml index 946192b86..7c3e6759d 100644 --- a/.github/workflows/ci-events-helsinki-check.yml +++ b/.github/workflows/ci-events-helsinki-check.yml @@ -11,7 +11,7 @@ on: - '.yarnrc.yml' - 'tsconfig.base.json' - '.prettier*' - - '.github/workflows/**' + - '.github/workflows/ci-events-helsinki-check.yml' pull_request: branches: [main] @@ -23,7 +23,7 @@ on: - '.yarnrc.yml' - 'tsconfig.base.json' - '.prettier*' - - '.github/workflows/**' + - '.github/workflows/ci-events-helsinki-check.yml' env: CI: true diff --git a/.github/workflows/ci-hobbies-helsinki-check.yml b/.github/workflows/ci-hobbies-helsinki-check.yml index aaa6ada29..4027f2c93 100644 --- a/.github/workflows/ci-hobbies-helsinki-check.yml +++ b/.github/workflows/ci-hobbies-helsinki-check.yml @@ -11,7 +11,7 @@ on: - '.yarnrc.yml' - 'tsconfig.base.json' - '.prettier*' - - '.github/workflows/**' + - '.github/workflows/ci-hobbies-helsinki-check.yml' pull_request: branches: [main] @@ -23,7 +23,7 @@ on: - '.yarnrc.yml' - 'tsconfig.base.json' - '.prettier*' - - '.github/workflows/**' + - '.github/workflows/ci-hobbies-helsinki-check.yml' workflow_dispatch: jobs: diff --git a/.github/workflows/ci-monorepo-integrity.yml b/.github/workflows/ci-monorepo-integrity.yml index 3b394a838..e7ded0c46 100644 --- a/.github/workflows/ci-monorepo-integrity.yml +++ b/.github/workflows/ci-monorepo-integrity.yml @@ -8,7 +8,7 @@ on: paths: - 'yarn.lock' - '.yarnrc.yml' - - '.github/workflows/**' + - '.github/workflows/ci-monorepo-integrity.yml' pull_request: types: @@ -18,7 +18,7 @@ on: paths: - 'yarn.lock' - '.yarnrc.yml' - - '.github/workflows/**' + - '.github/workflows/ci-monorepo-integrity.yml' jobs: test: diff --git a/.github/workflows/ci-packages.yml b/.github/workflows/ci-packages.yml index 4faa1c6cf..15d826c2d 100644 --- a/.github/workflows/ci-packages.yml +++ b/.github/workflows/ci-packages.yml @@ -12,7 +12,7 @@ on: - '.prettier*' - 'tsconfig.base.json' - '.prettier*' - - '.github/workflows/**' + - '.github/workflows/ci-packages.yml' pull_request: types: @@ -26,7 +26,7 @@ on: - '.prettier*' - 'tsconfig.base.json' - '.prettier*' - - '.github/workflows/**' + - '.github/workflows/ci-packages.yml' env: CI: true diff --git a/.github/workflows/ci-sports-helsinki-check.yml b/.github/workflows/ci-sports-helsinki-check.yml index 3ccbb20be..c79793538 100644 --- a/.github/workflows/ci-sports-helsinki-check.yml +++ b/.github/workflows/ci-sports-helsinki-check.yml @@ -11,7 +11,7 @@ on: - '.yarnrc.yml' - 'tsconfig.base.json' - '.prettier*' - - '.github/workflows/**' + - '.github/workflows/ci-sports-helsinki-check.yml' pull_request: branches: [main] @@ -23,7 +23,7 @@ on: - '.yarnrc.yml' - 'tsconfig.base.json' - '.prettier*' - - '.github/workflows/**' + - '.github/workflows/ci-sports-helsinki-check.yml' jobs: common: diff --git a/.github/workflows/ci-venue-graphql-proxy-check.yml b/.github/workflows/ci-venue-graphql-proxy-check.yml index 887e49425..0a6a248c9 100644 --- a/.github/workflows/ci-venue-graphql-proxy-check.yml +++ b/.github/workflows/ci-venue-graphql-proxy-check.yml @@ -9,7 +9,7 @@ on: - '.yarnrc.yml' - 'tsconfig.base.json' - '.prettier*' - - '.github/workflows/**' + - '.github/workflows/ci-venue-graphql-proxy-check.yml' pull_request: branches: [main] @@ -19,7 +19,7 @@ on: - '.yarnrc.yml' - 'tsconfig.base.json' - '.prettier*' - - '.github/workflows/**' + - '.github/workflows/ci-venue-graphql-proxy-check.yml' workflow_dispatch: jobs: From 64428bf74d884d31dfffcb8aec69e17279615920 Mon Sep 17 00:00:00 2001 From: Tero Virtanen Date: Thu, 26 Jun 2025 15:43:26 +0300 Subject: [PATCH 12/19] build: events proxy variables --- .github/workflows/ci-events-graphql-proxy-check.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-events-graphql-proxy-check.yml b/.github/workflows/ci-events-graphql-proxy-check.yml index 5ded713d7..691a5b72f 100644 --- a/.github/workflows/ci-events-graphql-proxy-check.yml +++ b/.github/workflows/ci-events-graphql-proxy-check.yml @@ -34,9 +34,9 @@ jobs: echo "NODE_ENV=production" >> $GITHUB_ENV echo "GRAPHQL_PROXY_DEBUG=1" >> $GITHUB_ENV echo "GRAPHQL_PROXY_PORT=4100" >> $GITHUB_ENV - echo "GRAPHQL_PROXY_SENTRY_ENVIRONMENT=local" >> $GITHUB_ENV + echo "GRAPHQL_PROXY_API_BASE_URL=https://api.hel.fi/linkedevents/v1/" >> $GITHUB_ENV + echo "GRAPHQL_PROXY_MAP_OPEN_DATA_API_BASE_URL=https://kartta.hel.fi/ws/geoserver/avoindata" >> $GITHUB_ENV echo "GRAPHQL_PROXY_DISABLE_WINSTON_LOGGING=1" >> $GITHUB_ENV echo "GRAPHQL_PROXY_INTROSPECTION=1" >> $GITHUB_ENV - # events proxy only - echo "GRAPHQL_PROXY_MAP_OPEN_DATA_API_BASE_URL=https://kartta.hel.fi/ws/geoserver/avoindata" >> $GITHUB_ENV - echo "GRAPHQL_PROXY_API_BASE_URL=https://api.hel.fi/linkedevents/v1/" >> $GITHUB_ENV + echo "GRAPHQL_PROXY_SENTRY_ENVIRONMENT=local" >> $GITHUB_ENV + echo "GRAPHQL_PROXY_SENTRY_DSN=https://0b946822a84596cdd0453aa5d93d3b9e@sentry.test.hel.ninja/219" >> $GITHUB_ENV \ No newline at end of file From 5ca3c0b86d1ce226f91e2ba781d82233e7a3880e Mon Sep 17 00:00:00 2001 From: Tero Virtanen Date: Fri, 27 Jun 2025 07:07:36 +0300 Subject: [PATCH 13/19] build: events proxy variables --- .github/workflows/ci-events-graphql-proxy-check.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-events-graphql-proxy-check.yml b/.github/workflows/ci-events-graphql-proxy-check.yml index 691a5b72f..cca5368f3 100644 --- a/.github/workflows/ci-events-graphql-proxy-check.yml +++ b/.github/workflows/ci-events-graphql-proxy-check.yml @@ -39,4 +39,7 @@ jobs: echo "GRAPHQL_PROXY_DISABLE_WINSTON_LOGGING=1" >> $GITHUB_ENV echo "GRAPHQL_PROXY_INTROSPECTION=1" >> $GITHUB_ENV echo "GRAPHQL_PROXY_SENTRY_ENVIRONMENT=local" >> $GITHUB_ENV - echo "GRAPHQL_PROXY_SENTRY_DSN=https://0b946822a84596cdd0453aa5d93d3b9e@sentry.test.hel.ninja/219" >> $GITHUB_ENV \ No newline at end of file + echo "GRAPHQL_PROXY_SENTRY_DSN=https://0b946822a84596cdd0453aa5d93d3b9e@sentry.test.hel.ninja/219" >> $GITHUB_ENV + echo "NEXT_PUBLIC_CMS_HEADER_MENU_NAME_EN=Hobbies Helsinki Header EN" >> $GITHUB_ENV + echo "NEXT_PUBLIC_CMS_HEADER_MENU_NAME_FI=Hobbies Helsinki Header FI" >> $GITHUB_ENV + echo "NEXT_PUBLIC_CMS_HEADER_MENU_NAME_SV=Hobbies Helsinki Header SV" >> $GITHUB_ENV From feaf12c3ce2d6cf1818a6217fbce2fb7c2eaae0d Mon Sep 17 00:00:00 2001 From: Tero Virtanen Date: Fri, 27 Jun 2025 07:19:05 +0300 Subject: [PATCH 14/19] build: events proxy variables --- .github/workflows/ci-events-graphql-proxy-check.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-events-graphql-proxy-check.yml b/.github/workflows/ci-events-graphql-proxy-check.yml index cca5368f3..1d59e69d5 100644 --- a/.github/workflows/ci-events-graphql-proxy-check.yml +++ b/.github/workflows/ci-events-graphql-proxy-check.yml @@ -31,14 +31,12 @@ jobs: typecheck: true app-directory: proxies/events-graphql-proxy extra-commands: | - echo "NODE_ENV=production" >> $GITHUB_ENV - echo "GRAPHQL_PROXY_DEBUG=1" >> $GITHUB_ENV echo "GRAPHQL_PROXY_PORT=4100" >> $GITHUB_ENV echo "GRAPHQL_PROXY_API_BASE_URL=https://api.hel.fi/linkedevents/v1/" >> $GITHUB_ENV echo "GRAPHQL_PROXY_MAP_OPEN_DATA_API_BASE_URL=https://kartta.hel.fi/ws/geoserver/avoindata" >> $GITHUB_ENV - echo "GRAPHQL_PROXY_DISABLE_WINSTON_LOGGING=1" >> $GITHUB_ENV + echo "GRAPHQL_PROXY_DISABLE_WINSTON_LOGGING=0" >> $GITHUB_ENV echo "GRAPHQL_PROXY_INTROSPECTION=1" >> $GITHUB_ENV - echo "GRAPHQL_PROXY_SENTRY_ENVIRONMENT=local" >> $GITHUB_ENV + echo "GRAPHQL_PROXY_SENTRY_ENVIRONMENT=development" >> $GITHUB_ENV echo "GRAPHQL_PROXY_SENTRY_DSN=https://0b946822a84596cdd0453aa5d93d3b9e@sentry.test.hel.ninja/219" >> $GITHUB_ENV echo "NEXT_PUBLIC_CMS_HEADER_MENU_NAME_EN=Hobbies Helsinki Header EN" >> $GITHUB_ENV echo "NEXT_PUBLIC_CMS_HEADER_MENU_NAME_FI=Hobbies Helsinki Header FI" >> $GITHUB_ENV From d9f6d9dc9d8e8687b588082d44550b797fb99641 Mon Sep 17 00:00:00 2001 From: Tero Virtanen Date: Fri, 27 Jun 2025 07:30:23 +0300 Subject: [PATCH 15/19] build: events proxy variables --- .github/workflows/ci-events-graphql-proxy-check.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/ci-events-graphql-proxy-check.yml b/.github/workflows/ci-events-graphql-proxy-check.yml index 1d59e69d5..208180e65 100644 --- a/.github/workflows/ci-events-graphql-proxy-check.yml +++ b/.github/workflows/ci-events-graphql-proxy-check.yml @@ -38,6 +38,3 @@ jobs: echo "GRAPHQL_PROXY_INTROSPECTION=1" >> $GITHUB_ENV echo "GRAPHQL_PROXY_SENTRY_ENVIRONMENT=development" >> $GITHUB_ENV echo "GRAPHQL_PROXY_SENTRY_DSN=https://0b946822a84596cdd0453aa5d93d3b9e@sentry.test.hel.ninja/219" >> $GITHUB_ENV - echo "NEXT_PUBLIC_CMS_HEADER_MENU_NAME_EN=Hobbies Helsinki Header EN" >> $GITHUB_ENV - echo "NEXT_PUBLIC_CMS_HEADER_MENU_NAME_FI=Hobbies Helsinki Header FI" >> $GITHUB_ENV - echo "NEXT_PUBLIC_CMS_HEADER_MENU_NAME_SV=Hobbies Helsinki Header SV" >> $GITHUB_ENV From d6f22cd0167a2a0d5e6e77e0b8f6d0de089306ad Mon Sep 17 00:00:00 2001 From: Tero Virtanen Date: Fri, 27 Jun 2025 07:39:04 +0300 Subject: [PATCH 16/19] build: ci integrity node version --- .github/workflows/ci-events-graphql-proxy-check.yml | 2 +- .github/workflows/ci-monorepo-integrity.yml | 11 +++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci-events-graphql-proxy-check.yml b/.github/workflows/ci-events-graphql-proxy-check.yml index 208180e65..ecbdde4a0 100644 --- a/.github/workflows/ci-events-graphql-proxy-check.yml +++ b/.github/workflows/ci-events-graphql-proxy-check.yml @@ -27,7 +27,7 @@ jobs: uses: City-of-Helsinki/.github/.github/workflows/ci-node.yml@ci_node_parameters secrets: inherit with: - node-version: 16 + node-version: 20 typecheck: true app-directory: proxies/events-graphql-proxy extra-commands: | diff --git a/.github/workflows/ci-monorepo-integrity.yml b/.github/workflows/ci-monorepo-integrity.yml index e7ded0c46..4075c8032 100644 --- a/.github/workflows/ci-monorepo-integrity.yml +++ b/.github/workflows/ci-monorepo-integrity.yml @@ -2,19 +2,14 @@ name: CI-monorepo-integrity on: push: - branches: - - dev - - main + branches: [main] paths: - 'yarn.lock' - '.yarnrc.yml' - '.github/workflows/ci-monorepo-integrity.yml' pull_request: - types: - - opened - - synchronize - - reopened + branches: [main] paths: - 'yarn.lock' - '.yarnrc.yml' @@ -25,7 +20,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [16.x] + node-version: [20.x] steps: - uses: actions/checkout@v4 From 0003838af023d55e80e6ab24abaffb487f7e241b Mon Sep 17 00:00:00 2001 From: Tero Virtanen Date: Fri, 27 Jun 2025 08:53:37 +0300 Subject: [PATCH 17/19] build: sports CSS size limit --- apps/sports-helsinki/.size-limit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/sports-helsinki/.size-limit.js b/apps/sports-helsinki/.size-limit.js index 6530766fa..58e8fa07b 100644 --- a/apps/sports-helsinki/.size-limit.js +++ b/apps/sports-helsinki/.size-limit.js @@ -41,6 +41,6 @@ module.exports = [ { name: 'CSS', path: ['.next/static/css/**/*.css'], - limit: '40 kB', // NOTE: this is much, should be around 10 kb + limit: '42 kB', // NOTE: this is much, should be around 10 kb }, ]; From 9f5ad65fb353b783a2b8b791701eea1b90a81c72 Mon Sep 17 00:00:00 2001 From: Tero Virtanen Date: Fri, 27 Jun 2025 10:07:42 +0300 Subject: [PATCH 18/19] build: ci apps skip static generation --- .github/workflows/ci-events-helsinki-check.yml | 1 + .github/workflows/ci-hobbies-helsinki-check.yml | 1 + .github/workflows/ci-sports-helsinki-check.yml | 1 + 3 files changed, 3 insertions(+) diff --git a/.github/workflows/ci-events-helsinki-check.yml b/.github/workflows/ci-events-helsinki-check.yml index 7c3e6759d..8679d57ce 100644 --- a/.github/workflows/ci-events-helsinki-check.yml +++ b/.github/workflows/ci-events-helsinki-check.yml @@ -64,3 +64,4 @@ jobs: echo "NEXT_PUBLIC_MATOMO_SRC_URL=piwik.min.js" >> $GITHUB_ENV echo "NEXT_PUBLIC_MATOMO_TRACKER_URL=tracker.php" >> $GITHUB_ENV echo "NEXT_PUBLIC_MATOMO_ENABLED=0" >> $GITHUB_ENV + echo "SKIP_BUILD_STATIC_GENERATION=1" >> $GITHUB_ENV diff --git a/.github/workflows/ci-hobbies-helsinki-check.yml b/.github/workflows/ci-hobbies-helsinki-check.yml index 4027f2c93..3e87af760 100644 --- a/.github/workflows/ci-hobbies-helsinki-check.yml +++ b/.github/workflows/ci-hobbies-helsinki-check.yml @@ -59,3 +59,4 @@ jobs: echo "NEXT_PUBLIC_MATOMO_SRC_URL=piwik.min.js" >> $GITHUB_ENV echo "NEXT_PUBLIC_MATOMO_TRACKER_URL=tracker.php" >> $GITHUB_ENV echo "NEXT_PUBLIC_MATOMO_ENABLED=0" >> $GITHUB_ENV + echo "SKIP_BUILD_STATIC_GENERATION=1" >> $GITHUB_ENV diff --git a/.github/workflows/ci-sports-helsinki-check.yml b/.github/workflows/ci-sports-helsinki-check.yml index c79793538..c8e36deed 100644 --- a/.github/workflows/ci-sports-helsinki-check.yml +++ b/.github/workflows/ci-sports-helsinki-check.yml @@ -58,3 +58,4 @@ jobs: echo "NEXT_PUBLIC_MATOMO_SRC_URL=piwik.min.js" >> $GITHUB_ENV echo "NEXT_PUBLIC_MATOMO_TRACKER_URL=tracker.php" >> $GITHUB_ENV echo "NEXT_PUBLIC_MATOMO_ENABLED=0" >> $GITHUB_ENV + echo "SKIP_BUILD_STATIC_GENERATION=1" >> $GITHUB_ENV From 4a0dfa6f83b27e6c8186676c9577153adc9fe7cd Mon Sep 17 00:00:00 2001 From: Tero Virtanen Date: Fri, 27 Jun 2025 13:17:11 +0300 Subject: [PATCH 19/19] build: workflow template from main branch --- .github/workflows/ci-events-graphql-proxy-check.yml | 2 +- .github/workflows/ci-events-helsinki-check.yml | 2 +- .github/workflows/ci-hobbies-helsinki-check.yml | 2 +- .github/workflows/ci-sports-helsinki-check.yml | 2 +- .github/workflows/ci-venue-graphql-proxy-check.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci-events-graphql-proxy-check.yml b/.github/workflows/ci-events-graphql-proxy-check.yml index ecbdde4a0..c01706962 100644 --- a/.github/workflows/ci-events-graphql-proxy-check.yml +++ b/.github/workflows/ci-events-graphql-proxy-check.yml @@ -24,7 +24,7 @@ on: jobs: common: - uses: City-of-Helsinki/.github/.github/workflows/ci-node.yml@ci_node_parameters + uses: City-of-Helsinki/.github/.github/workflows/ci-node.yml@main secrets: inherit with: node-version: 20 diff --git a/.github/workflows/ci-events-helsinki-check.yml b/.github/workflows/ci-events-helsinki-check.yml index 8679d57ce..5f356446b 100644 --- a/.github/workflows/ci-events-helsinki-check.yml +++ b/.github/workflows/ci-events-helsinki-check.yml @@ -33,7 +33,7 @@ env: jobs: common: - uses: City-of-Helsinki/.github/.github/workflows/ci-node.yml@ci_node_parameters + uses: City-of-Helsinki/.github/.github/workflows/ci-node.yml@main secrets: inherit with: node-version: 20 diff --git a/.github/workflows/ci-hobbies-helsinki-check.yml b/.github/workflows/ci-hobbies-helsinki-check.yml index 3e87af760..0c49526e0 100644 --- a/.github/workflows/ci-hobbies-helsinki-check.yml +++ b/.github/workflows/ci-hobbies-helsinki-check.yml @@ -28,7 +28,7 @@ on: jobs: common: - uses: City-of-Helsinki/.github/.github/workflows/ci-node.yml@ci_node_parameters + uses: City-of-Helsinki/.github/.github/workflows/ci-node.yml@main secrets: inherit with: node-version: 20 diff --git a/.github/workflows/ci-sports-helsinki-check.yml b/.github/workflows/ci-sports-helsinki-check.yml index c8e36deed..35740d042 100644 --- a/.github/workflows/ci-sports-helsinki-check.yml +++ b/.github/workflows/ci-sports-helsinki-check.yml @@ -27,7 +27,7 @@ on: jobs: common: - uses: City-of-Helsinki/.github/.github/workflows/ci-node.yml@ci_node_parameters + uses: City-of-Helsinki/.github/.github/workflows/ci-node.yml@main secrets: inherit with: node-version: 20 diff --git a/.github/workflows/ci-venue-graphql-proxy-check.yml b/.github/workflows/ci-venue-graphql-proxy-check.yml index 0a6a248c9..8928d088a 100644 --- a/.github/workflows/ci-venue-graphql-proxy-check.yml +++ b/.github/workflows/ci-venue-graphql-proxy-check.yml @@ -24,7 +24,7 @@ on: jobs: common: - uses: City-of-Helsinki/.github/.github/workflows/ci-node.yml@ci_node_parameters + uses: City-of-Helsinki/.github/.github/workflows/ci-node.yml@main secrets: inherit with: node-version: 20