Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 10 additions & 17 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
name: Continuous integration
name: CI

on:
pull_request:
push:
branches:
- main
tags:
- 'release-*'
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 22
- run: yarn
- run: yarn lint
- run: yarn test
- run: yarn build
common:
uses: City-of-Helsinki/.github/.github/workflows/ci-node.yml@main
secrets: inherit
with:
node-version: 22
2 changes: 1 addition & 1 deletion .github/workflows/npm-publish-canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 20
node-version: 22
registry-url: https://registry.npmjs.org/
- run: yarn
- run: yarn test
Expand Down
29 changes: 12 additions & 17 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
name: publish
name: npm publish

on:
release:
types: [created]
push:
tags:
- 'v*.*.*' # Trigger on version tags

jobs:
publish-npm-stable:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- run: yarn
- run: yarn test
- run: yarn build
- run: yarn publish-stable
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
publish:
uses: City-of-Helsinki/.github/.github/workflows/ci-npm-publish.yml@main
with:
node-version: '22'
package-manager: 'yarn'
install-command: 'yarn --frozen-lockfile'
test-command: 'yarn test'
build-command: 'yarn build'
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ react-helsinki-headless-cms.iml
dist
storybook-static

.env
.env
coverage
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"lint-fix": "yarn eslint \"src/**/*.{ts,tsx}\" --fix && yarn prettier ./src -w",
"test": "jest",
"test-storybook": "test-storybook",
"test:coverage": "jest --coverage",
"build": "rollup -c --bundleConfigAsCjs",
"docker:dev": "cross-env DOCKER_TARGET=development docker compose up",
"docker:prod": "cross-env DOCKER_TARGET=production docker compose up",
Expand Down
19 changes: 19 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
sonar.projectKey=city-of-helsinki_react-helsinki-headless-cms
sonar.organization=city-of-helsinki
sonar.projectName=react-helsinki-headless-cms

# Path is relative to the sonar-project.properties file. Defaults to .
sonar.sources=src

# Encoding of the source code. Default is default system encoding
sonar.sourceEncoding=UTF-8

# Paths to exclude from analysis
sonar.exclusions=**/node_modules/**,**/dist/**,**/lib/**,**/coverage/**,**/.storybook/**,**/scripts/**,**/*.d.ts

# Paths to test files
sonar.tests=src
sonar.test.inclusions=src/**/*.test.ts,src/**/*.test.tsx,src/**/__tests__/**/*.{ts,tsx}

# Coverage report
sonar.javascript.lcov.reportPaths=coverage/lcov.info
Loading