Skip to content

fix: typo in "visa allt" #2246

fix: typo in "visa allt"

fix: typo in "visa allt" #2246

Workflow file for this run

name: CI-packages
on:
push:
branches:
- dev
- main
paths:
- 'packages/**'
- '.yarnrc.yml'
- 'yarn.lock'
- '.prettier*'
- 'tsconfig.base.json'
- '.prettier*'
- '.github/workflows/ci-packages.yml'
pull_request:
types:
- opened
- synchronize
- reopened
paths:
- 'packages/**'
- '.yarnrc.yml'
- 'yarn.lock'
- '.prettier*'
- 'tsconfig.base.json'
- '.prettier*'
- '.github/workflows/ci-packages.yml'
env:
CI: true
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22.x]
steps:
- 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@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: Restore packages cache
uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/.cache
${{ github.workspace }}/**/tsconfig.tsbuildinfo
key: ${{ runner.os }}-packages-cache-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('packages/**.[jt]sx?', 'packages/**.json') }}
restore-keys: |
${{ runner.os }}-packages-cache-${{ hashFiles('**/yarn.lock') }}-
- name: Install dependencies
run: |
yarn install --immutable --inline-builds
env:
HUSKY: 0
# Typecheck packages that have changed + packages and apps that depends on them (--from & --since)
# That allows to see if we're introducing "surface" regressions (just the types)
- name: Typecheck
run: |
yarn workspaces foreach -tv --from '@events-helsinki/*' --since=origin/main --recursive run typecheck
# Lint packages that have changed (--include & --since)
- name: Linter
run: |
yarn workspaces foreach -tv --include '@events-helsinki/*' --since=origin/main --recursive run lint
yarn workspaces foreach -tv --include '@events-helsinki/*' --since=origin/main --recursive run lint-styles
# Test packages that have changed (--include & --since)
- name: Unit tests changed packages
run: |
yarn workspaces foreach -tv --include '@events-helsinki/*' --since=origin/main --recursive run test --coverage
# to debug cache issues: ls ${{ github.workspace }}/.cache
# Build packages that have changed (--include & --since), assuming that
# apps build are done already. Otherwise --from & --since
- name: Run build for changed packages
run: |
yarn workspaces foreach -tv --include '@events-helsinki/*' --since=origin/main run build
# Test storybook build on packages that have changed (--include & --since)
- name: Run storybook build for changed packages
run: |
yarn workspaces foreach -tv --exclude hobbies-helsinki --exclude events-helsinki --exclude sports-helsinki --since=origin/main run build-storybook
- name: Run tests
working-directory: packages/components
run: yarn test:coverage
env:
CI: true
- name: SonarQube Cloud Scan
uses: SonarSource/sonarqube-scan-action@v6
with:
projectBaseDir: packages/components
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}