Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
26 changes: 26 additions & 0 deletions .github/actions/ci/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: CI

description: Shared action to install dependencies

runs:
using: composite

steps:
- name: Read .nvmrc
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would it make sense to add the checkout step here also, as it would ensure that the .nvmrc is present

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really, it is not necessary here as the repo is already checked-out in the step before. Also we are only just reading out the .nvmrc and making the version within available in the environment.

id: nvm
run: echo "NVMRC=$(cat .nvmrc)" >> $GITHUB_OUTPUT
shell: bash

- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version-file: ".nvmrc"
cache: "yarn"

# Whenever on a changeset versioning PR
# Then installing can not fail with lockfile changes
# Because the package.json for integration test changes.

- name: Install
run: yarn install --immutable
shell: bash
11 changes: 5 additions & 6 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ on:
event:
description: "TypeDoc deploy"
required: true
permissions: {}

permissions:
pages: write # to deploy to Pages
id-token: write

jobs:
# Build job
Expand All @@ -29,11 +32,7 @@ jobs:
# Deploy job
deploy:
runs-on: ubuntu-latest
needs: build

permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
needs: build # to verify the deployment originates from an appropriate source

# Deploy to the github-pages environment
environment:
Expand Down
132 changes: 132 additions & 0 deletions .github/workflows/qa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
name: Qa

permissions:
contents: read
pull-requests: write

on:
push:
branches:
- 'master'
- '!changeset-release/**'

pull_request:

jobs:
immutable-install:
if: ${{ !startsWith(github.ref, 'refs/heads/changeset-release/') }}
name: Immutable Install
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Setup
uses: ./.github/actions/ci

# The shared install action does not respect the
# `--immutable` flag, so we need to run it here.
- name: Install with lockfile
run: yarn install --immutable

linting:
Comment thread Fixed
if: ${{ !startsWith(github.ref, 'refs/heads/changeset-release/') }}
name: Linting
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Setup
uses: ./.github/actions/ci

- name: Lint
run: yarn format

type-checking:
Comment thread Fixed
if: ${{ !startsWith(github.ref, 'refs/heads/changeset-release/') }}
name: Type checking
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Setup
uses: ./.github/actions/ci

- name: TypeScript
run: yarn typecheck

testing:
Comment thread Fixed
if: ${{ !startsWith(github.ref, 'refs/heads/changeset-release/') }}
name: Testing
needs: [immutable-install, linting, type-checking]
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Setup
uses: ./.github/actions/ci

- name: Build
run: yarn build

- uses: oNaiPs/secrets-to-env-action@ec46a22bfc9b37e014b627b3208b07eb8909ea0f # v1.5
with:
secrets: ${{ toJSON(secrets) }}
Comment thread Fixed
Comment thread Dismissed

- name: Test (Examples)
run: |
cd examples
yarn install --immutable
yarn test

- name: Test (Unit)
run: yarn test:unit

- name: Test (Integration)
run: yarn test --coverage

- name: Upload Coverage Report
uses: codecov/codecov-action@v5 #2db07e317924c76f654a414629d71c65876882e2 v5.4.3
with:
file: coverage/clover.xml
token: ${{ secrets.CODECOV_TOKEN }}
flags: test-coverage

regression-testing:
Comment thread Fixed
if: ${{ !startsWith(github.ref, 'refs/heads/changeset-release/') }}
name: Regression Testing
needs: [testing]
runs-on: ubuntu-latest
strategy:
matrix:
version: [18, 20]
fail-fast: true
max-parallel: 1

steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Setup
uses: ./.github/actions/ci

- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: ${{ matrix.version }}

- name: Build
run: yarn build

- uses: oNaiPs/secrets-to-env-action@ec46a22bfc9b37e014b627b3208b07eb8909ea0f # v1.5
with:
secrets: ${{ toJSON(secrets) }}
Comment thread Dismissed

- name: Integration tests
run: yarn test
Comment thread Fixed
24 changes: 2 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,28 +38,8 @@ jobs:
# https://github.community/t/action-does-not-trigger-another-on-push-tag-action/17148/8
token: ${{ steps.generate_github_token.outputs.token }}

- name: Read .nvmrc
run: echo "NVMRC=$(cat .nvmrc)" >> $GITHUB_OUTPUT
id: nvm

- name: Setup Node (uses version in .nvmrc)
uses: actions/setup-node@v4
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'

- name: Get yarn cache
id: yarn-cache
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Setup
uses: ./.github/actions/ci

- name: Creating .npmrc
run: |
Expand Down
File renamed without changes.
Loading