Skip to content

Commit

Permalink
FEAT(CI): Add pipeline for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rogaldh committed Mar 4, 2024
1 parent f7f0a13 commit b0a92ea
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 3 deletions.
90 changes: 90 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Test

on:
pull_request:
push:
branches:
- master
env:
CACHE_AFFIX: pnpm-packages
CI: true
PNPM_CACHE_FOLDER: .pnpm-store
PNPM_VERSION: 8

jobs:
test:
name: Testing
runs-on: ubuntu-latest
steps:
- name: checkout code repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: install pnpm package manager
uses: pnpm/action-setup@v2
with:
version: ${{ env.PNPM_VERSION }}

- name: setup node.js
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc

- name: setup pnpm config
run: pnpm config set store-dir $PNPM_CACHE_FOLDER

- name: restore cache for packages if applicable
uses: actions/cache@v3
id: packages-cache
with:
path: "${{ env.PNPM_CACHE_FOLDER }}"
key: ${{ runner.os }}-${{ env.CACHE_AFFIX }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-${{ env.CACHE_AFFIX }}-
- name: install dependencies
run: pnpm install --frozen-lockfile

- name: Testing
run: |
pnpm lint
pnpm t
smoke:
name: Smoke Testing
runs-on: ubuntu-latest
steps:
- name: checkout code repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: install pnpm package manager
uses: pnpm/action-setup@v2
with:
version: ${{ env.PNPM_VERSION }}

- name: setup node.js
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc

- name: setup pnpm config
run: pnpm config set store-dir $PNPM_CACHE_FOLDER

- name: restore cache for packages if applicable
uses: actions/cache@v3
id: packages-cache
with:
path: "${{ env.PNPM_CACHE_FOLDER }}"
key: ${{ runner.os }}-${{ env.CACHE_AFFIX }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-${{ env.CACHE_AFFIX }}-
- name: install dependencies
run: |
pnpm install --frozen-lockfile
npx playwright install
- name: Testing
run: pnpm --filter "@solana/*ui" run ci:test-smoke
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v21.6
6 changes: 3 additions & 3 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
"build-storybook": "storybook build",
"ci:sb": "pnpm run storybook --no-open --quiet --no-version-updates",
"ci:sb-kill": "kill -2 $(lsof -t -i:6006)",
"ci:test-sb": "wait-on tcp:6006 && pnpm run test-sb && pnpm run ci:sb-kill",
"ci:sb-test": "wait-on tcp:6006 && pnpm run test-sb && pnpm run ci:sb-kill",
"ci:test-smoke": "concurrently --raw \"pnpm run ci:sb\" \"pnpm run ci:sb-test\" --kill-others-on-fail",
"lint": "prettier ./src/** ./**/*config.[jt]s --check",
"lint-fix": "pnpm run lint --w",
"storybook": "storybook dev -p 6006",
"test": "tsc --noEmit",
"test-sb": "test-storybook --browsers chromium, firefox",
"test-smoke": "concurrently --raw \"pnpm run ci:sb\" \"pnpm run ci:test-sb\" --kill-others-on-fail"
"test-sb": "test-storybook --browsers chromium, firefox"
},
"browserslist": "defaults, not ie <= 11",
"dependencies": {
Expand Down

0 comments on commit b0a92ea

Please sign in to comment.