diff --git a/.github/workflows/bf-applicant-frontend-tests.yml b/.github/workflows/bf-applicant-frontend-tests.yml index 141957fe28..084009c4fd 100644 --- a/.github/workflows/bf-applicant-frontend-tests.yml +++ b/.github/workflows/bf-applicant-frontend-tests.yml @@ -7,59 +7,12 @@ on: push: branches: [main] workflow_dispatch: -defaults: - run: - working-directory: ./frontend/benefit/applicant + jobs: - test: - name: Test - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Setup Node.js environment - uses: actions/setup-node@v3 - with: - node-version: "22" - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn config get cacheFolder)" - - uses: actions/cache@v3 - id: yarn-cache - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - name: Install dependencies - run: yarn --prefer-offline --frozen-lockfile --check-files - - name: Run linter - run: yarn lint - - name: Run tests - run: yarn test:coverage - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 - build: - name: Build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Setup Node.js environment - uses: actions/setup-node@v3 - with: - node-version: "22" - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn config get cacheFolder)" - - uses: actions/cache@v3 - id: yarn-cache - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - name: Install dependencies - run: yarn --prefer-offline --frozen-lockfile --check-files - - name: Check that building dev application works - env: - NEXTJS_DISABLE_SENTRY: true - run: yarn build + common: + uses: City-of-Helsinki/.github/.github/workflows/ci-node.yml@main + secrets: inherit + with: + node-version: 22.x + working-directory: ./frontend/benefit/applicant + extra-commands: echo 'NEXTJS_DISABLE_SENTRY=true' >> .env diff --git a/.github/workflows/bf-handler-frontend-tests.yml b/.github/workflows/bf-handler-frontend-tests.yml index 0ac9aa6bd6..3dbe6759e9 100644 --- a/.github/workflows/bf-handler-frontend-tests.yml +++ b/.github/workflows/bf-handler-frontend-tests.yml @@ -7,59 +7,12 @@ on: push: branches: [main] workflow_dispatch: -defaults: - run: - working-directory: ./frontend/benefit/handler + jobs: - test: - name: Test - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Setup Node.js environment - uses: actions/setup-node@v3 - with: - node-version: "22" - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn config get cacheFolder)" - - uses: actions/cache@v3 - id: yarn-cache - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - name: Install dependencies - run: yarn --prefer-offline --frozen-lockfile --check-files - - name: Run linter - run: yarn lint - - name: Run tests - run: yarn test:coverage - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 - build: - name: Build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Setup Node.js environment - uses: actions/setup-node@v3 - with: - node-version: "22" - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn config get cacheFolder)" - - uses: actions/cache@v3 - id: yarn-cache - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - name: Install dependencies - run: yarn --prefer-offline --frozen-lockfile --check-files - - name: Check that building dev application works - env: - NEXTJS_DISABLE_SENTRY: true - run: yarn build + common: + uses: City-of-Helsinki/.github/.github/workflows/ci-node.yml@main + secrets: inherit + with: + node-version: 22.x + working-directory: ./frontend/benefit/handler + extra-commands: echo 'NEXTJS_DISABLE_SENTRY=true' >> .env \ No newline at end of file diff --git a/.github/workflows/bf-shared-frontend-tests.yml b/.github/workflows/bf-shared-frontend-tests.yml index 78296e5182..890f3ef898 100644 --- a/.github/workflows/bf-shared-frontend-tests.yml +++ b/.github/workflows/bf-shared-frontend-tests.yml @@ -1,40 +1,19 @@ name: Benefit-shared Lint, Unit and Component tests on: - push: - branches: [main] pull_request: paths: - ".github/workflows/bf-shared-frontend-tests.yml" + push: + branches: [main] workflow_dispatch: -defaults: - run: - working-directory: ./frontend/benefit/shared + jobs: - test: - name: Test - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Setup Node.js environment - uses: actions/setup-node@v3 - with: - node-version: "22" - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn config get cacheFolder)" - - uses: actions/cache@v3 - id: yarn-cache - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - name: Install dependencies - run: yarn --prefer-offline --frozen-lockfile --check-files - - name: Run linter - run: yarn lint - - name: Run tests - run: yarn test:coverage - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 + common: + uses: City-of-Helsinki/.github/.github/workflows/ci-node.yml@main + secrets: inherit + with: + node-version: 22.x + working-directory: ./frontend + app-directory: ./frontend/benefit/shared + skip-build: true \ No newline at end of file diff --git a/.github/workflows/ks-empl-frontend-tests.yml b/.github/workflows/ks-empl-frontend-tests.yml index c8790adcf1..a6f2ef79d6 100644 --- a/.github/workflows/ks-empl-frontend-tests.yml +++ b/.github/workflows/ks-empl-frontend-tests.yml @@ -7,60 +7,12 @@ on: paths: - ".github/workflows/ks-empl-frontend-tests.yml" workflow_dispatch: -defaults: - run: - working-directory: ./frontend/kesaseteli/employer -jobs: - test: - name: Test - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Setup Node.js environment - uses: actions/setup-node@v3 - with: - node-version: "22" - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn config get cacheFolder)" - - uses: actions/cache@v3 - id: yarn-cache - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - name: Install dependencies - run: yarn --prefer-offline --frozen-lockfile --check-files - - name: Run linter - run: yarn lint - - name: Run tests - run: yarn test:coverage - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 - build: - name: Build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Setup Node.js environment - uses: actions/setup-node@v3 - with: - node-version: "22" - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn config get cacheFolder)" - - uses: actions/cache@v3 - id: yarn-cache - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - name: Install dependencies - run: yarn --prefer-offline --frozen-lockfile --check-files - - name: Check that building dev application works - env: - NEXTJS_DISABLE_SENTRY: true - run: yarn build +jobs: + common: + uses: City-of-Helsinki/.github/.github/workflows/ci-node.yml@main + secrets: inherit + with: + node-version: 22.x + working-directory: ./frontend/kesaseteli/employer + extra-commands: echo 'NEXTJS_DISABLE_SENTRY=true' >> .env diff --git a/.github/workflows/ks-handler-frontend-tests.yml b/.github/workflows/ks-handler-frontend-tests.yml index aa2f853ec5..3e88484ff4 100644 --- a/.github/workflows/ks-handler-frontend-tests.yml +++ b/.github/workflows/ks-handler-frontend-tests.yml @@ -7,60 +7,12 @@ on: paths: - ".github/workflows/ks-handler-frontend-tests.yml" workflow_dispatch: -defaults: - run: - working-directory: ./frontend/kesaseteli/handler -jobs: - test: - name: Test - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Setup Node.js environment - uses: actions/setup-node@v3 - with: - node-version: "22" - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn config get cacheFolder)" - - uses: actions/cache@v3 - id: yarn-cache - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - name: Install dependencies - run: yarn --prefer-offline --frozen-lockfile --check-files - - name: Run linter - run: yarn lint - - name: Run tests - run: yarn test:coverage - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 - build: - name: Build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Setup Node.js environment - uses: actions/setup-node@v3 - with: - node-version: "22" - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn config get cacheFolder)" - - uses: actions/cache@v3 - id: yarn-cache - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - name: Install dependencies - run: yarn --prefer-offline --frozen-lockfile --check-files - - name: Check that building dev application works - env: - NEXTJS_DISABLE_SENTRY: true - run: yarn build +jobs: + common: + uses: City-of-Helsinki/.github/.github/workflows/ci-node.yml@main + secrets: inherit + with: + node-version: 22.x + working-directory: ./frontend/kesaseteli/handler + extra-commands: echo 'NEXTJS_DISABLE_SENTRY=true' >> .env diff --git a/.github/workflows/ks-shared-frontend-tests.yml b/.github/workflows/ks-shared-frontend-tests.yml index 5f72f894c1..9809b00ed2 100644 --- a/.github/workflows/ks-shared-frontend-tests.yml +++ b/.github/workflows/ks-shared-frontend-tests.yml @@ -1,40 +1,19 @@ name: Kesaseteli-shared Lint, Unit and Component tests on: - push: - branches: [main] pull_request: paths: - ".github/workflows/ks-shared-frontend-tests.yml" + push: + branches: [main] workflow_dispatch: -defaults: - run: - working-directory: ./frontend/kesaseteli/shared + jobs: - test: - name: Test - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Setup Node.js environment - uses: actions/setup-node@v3 - with: - node-version: "22" - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn config get cacheFolder)" - - uses: actions/cache@v3 - id: yarn-cache - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - name: Install dependencies - run: yarn --prefer-offline --frozen-lockfile --check-files - - name: Run linter - run: yarn lint - - name: Run tests - run: yarn test:coverage - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 + common: + uses: City-of-Helsinki/.github/.github/workflows/ci-node.yml@main + secrets: inherit + with: + node-version: 22.x + working-directory: ./frontend + app-directory: ./frontend/kesaseteli/shared + skip-build: true diff --git a/.github/workflows/ks-youth-frontend-tests.yml b/.github/workflows/ks-youth-frontend-tests.yml index 7880e3e194..399b77efd6 100644 --- a/.github/workflows/ks-youth-frontend-tests.yml +++ b/.github/workflows/ks-youth-frontend-tests.yml @@ -7,60 +7,12 @@ on: paths: - ".github/workflows/ks-youth-frontend-tests.yml" workflow_dispatch: -defaults: - run: - working-directory: ./frontend/kesaseteli/youth -jobs: - test: - name: Test - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Setup Node.js environment - uses: actions/setup-node@v3 - with: - node-version: "22" - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn config get cacheFolder)" - - uses: actions/cache@v3 - id: yarn-cache - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - name: Install dependencies - run: yarn --prefer-offline --frozen-lockfile --check-files - - name: Run linter - run: yarn lint - - name: Run tests - run: yarn test:coverage - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 - build: - name: Build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Setup Node.js environment - uses: actions/setup-node@v3 - with: - node-version: "22" - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn config get cacheFolder)" - - uses: actions/cache@v3 - id: yarn-cache - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - name: Install dependencies - run: yarn --prefer-offline --frozen-lockfile --check-files - - name: Check that building dev application works - env: - NEXTJS_DISABLE_SENTRY: true - run: yarn build +jobs: + common: + uses: City-of-Helsinki/.github/.github/workflows/ci-node.yml@main + secrets: inherit + with: + node-version: 22.x + working-directory: ./frontend/kesaseteli/youth + extra-commands: echo 'NEXTJS_DISABLE_SENTRY=true' >> .env diff --git a/.github/workflows/shared-frontend-tests.yml b/.github/workflows/shared-frontend-tests.yml index d281ed4dc5..8a0c0c5591 100644 --- a/.github/workflows/shared-frontend-tests.yml +++ b/.github/workflows/shared-frontend-tests.yml @@ -1,40 +1,19 @@ name: Shared Lint, Unit and Component tests on: - push: - branches: [main] pull_request: paths: - ".github/workflows/shared-tests.yml" + push: + branches: [main] workflow_dispatch: -defaults: - run: - working-directory: ./frontend/shared + jobs: - test: - name: Test - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Setup Node.js environment - uses: actions/setup-node@v3 - with: - node-version: "22" - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn config get cacheFolder)" - - uses: actions/cache@v3 - id: yarn-cache - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - name: Install dependencies - run: yarn --prefer-offline --frozen-lockfile --check-files - - name: Run linter - run: yarn lint - - name: Run tests - run: yarn test:coverage - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 + common: + uses: City-of-Helsinki/.github/.github/workflows/ci-node.yml@main + secrets: inherit + with: + node-version: 22.x + working-directory: ./frontend + app-directory: ./frontend/shared + skip-build: true \ No newline at end of file diff --git a/frontend/benefit/applicant/sonar-project.properties b/frontend/benefit/applicant/sonar-project.properties new file mode 100644 index 0000000000..4fb7aa4019 --- /dev/null +++ b/frontend/benefit/applicant/sonar-project.properties @@ -0,0 +1,8 @@ +sonar.projectKey = City-of-Helsinki_yjdh-helsinkilisa-applicant +sonar.organization = city-of-helsinki +sonar.javascript.lcov.reportPaths = ./coverage/lcov.info +sonar.sources = src +sonar.exclusions=**/__tests__/**,**/__mocks__/**,/test/**,/browser-tests/** +sonar.issue.ignore.multicriteria=e1 +sonar.issue.ignore.multicriteria.e1.ruleKey=typescript:S3735 +sonar.issue.ignore.multicriteria.e1.resourceKey=*.ts,*.tsx diff --git a/frontend/benefit/handler/sonar-project.properties b/frontend/benefit/handler/sonar-project.properties new file mode 100644 index 0000000000..c5fc8fac91 --- /dev/null +++ b/frontend/benefit/handler/sonar-project.properties @@ -0,0 +1,8 @@ +sonar.projectKey = City-of-Helsinki_yjdh-helsinkilisa-handler +sonar.organization = city-of-helsinki +sonar.javascript.lcov.reportPaths = ./coverage/lcov.info +sonar.sources = src +sonar.exclusions=**/__tests__/**,**/__mocks__/**,/browser-tests/** +sonar.issue.ignore.multicriteria=e1 +sonar.issue.ignore.multicriteria.e1.ruleKey=typescript:S3735 +sonar.issue.ignore.multicriteria.e1.resourceKey=*.ts,*.tsx \ No newline at end of file diff --git a/frontend/benefit/shared/sonar-project.properties b/frontend/benefit/shared/sonar-project.properties new file mode 100644 index 0000000000..a56754d332 --- /dev/null +++ b/frontend/benefit/shared/sonar-project.properties @@ -0,0 +1,8 @@ +sonar.projectKey = City-of-Helsinki_yjdh-helsinkilisa-shared +sonar.organization = city-of-helsinki +sonar.javascript.lcov.reportPaths = ./coverage/lcov.info +sonar.sources = src +sonar.exclusions=**/__tests__/**,**/__mocks__/**,/browser-tests/** +sonar.issue.ignore.multicriteria=e1 +sonar.issue.ignore.multicriteria.e1.ruleKey=typescript:S3735 +sonar.issue.ignore.multicriteria.e1.resourceKey=*.ts,*.tsx \ No newline at end of file diff --git a/frontend/kesaseteli/employer/sonar-project.properties b/frontend/kesaseteli/employer/sonar-project.properties new file mode 100644 index 0000000000..11c2bd64fb --- /dev/null +++ b/frontend/kesaseteli/employer/sonar-project.properties @@ -0,0 +1,5 @@ +sonar.projectKey = City-of-Helsinki_yjdh-kesaseteli-employer +sonar.organization = city-of-helsinki +sonar.javascript.lcov.reportPaths = ./coverage/lcov.info +sonar.sources = src +sonar.exclusions=**/__tests__/**,**/__mocks__/**,/browser-tests/** \ No newline at end of file diff --git a/frontend/kesaseteli/handler/sonar-project.properties b/frontend/kesaseteli/handler/sonar-project.properties new file mode 100644 index 0000000000..21496e5ba6 --- /dev/null +++ b/frontend/kesaseteli/handler/sonar-project.properties @@ -0,0 +1,5 @@ +sonar.projectKey = City-of-Helsinki_yjdh-kesaseteli-handler +sonar.organization = city-of-helsinki +sonar.javascript.lcov.reportPaths = ./coverage/lcov.info +sonar.sources = src +sonar.exclusions=**/__tests__/**,**/__mocks__/**,/browser-tests/** \ No newline at end of file diff --git a/frontend/kesaseteli/shared/sonar-project.properties b/frontend/kesaseteli/shared/sonar-project.properties new file mode 100644 index 0000000000..c806ad9674 --- /dev/null +++ b/frontend/kesaseteli/shared/sonar-project.properties @@ -0,0 +1,5 @@ +sonar.projectKey = City-of-Helsinki_yjdh-kesaseteli-shared +sonar.organization = city-of-helsinki +sonar.javascript.lcov.reportPaths = ./coverage/lcov.info +sonar.sources = src +sonar.exclusions=**/__tests__/**,**/__mocks__/**,/browser-tests/** \ No newline at end of file diff --git a/frontend/kesaseteli/youth/sonar-project.properties b/frontend/kesaseteli/youth/sonar-project.properties new file mode 100644 index 0000000000..644ff681a2 --- /dev/null +++ b/frontend/kesaseteli/youth/sonar-project.properties @@ -0,0 +1,5 @@ +sonar.projectKey = City-of-Helsinki_yjdh-kesaseteli-youth +sonar.organization = city-of-helsinki +sonar.javascript.lcov.reportPaths = ./coverage/lcov.info +sonar.sources = src +sonar.exclusions=**/__tests__/**,**/__mocks__/**,/browser-tests/** \ No newline at end of file