add authentication features such as Login and Logout #38
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Linting, Testing, Building | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
env: | |
NODE_VERSION: 20.11.0 | |
PNPM_VERSION: 8.10.2 | |
jobs: | |
cache-and-install: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v3 | |
name: Install pnpm v${{ env.PNPM_VERSION }} | |
with: | |
version: ${{ env.PNPM_VERSION }} | |
run_install: false | |
- name: Install Node.js v${{ env.NODE_VERSION }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
# - name: Get pnpm store directory | |
# shell: bash | |
# run: | | |
# echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
# - name: Setup pnpm cache | |
# uses: actions/cache@v4 | |
# id: cache-dependencies | |
# with: | |
# path: ${{ env.STORE_PATH }} | |
# key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
# restore-keys: | | |
# ${{ runner.os }}-pnpm-store- | |
- name: Install dependencies | |
# if: steps.cache-dependencies.outputs.cache-hit != 'true' | |
run: pnpm install | |
linting: | |
name: Linting js/ts and scss | |
runs-on: ubuntu-latest | |
needs: cache-and-install | |
steps: | |
- name: Code Checkout | |
uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v3 | |
name: Install pnpm v${{ env.PNPM_VERSION }} | |
with: | |
version: ${{ env.PNPM_VERSION }} | |
run_install: false | |
- name: Install NodeJS v${{ env.NODE_VERSION }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
cache: pnpm | |
- name: Install dependencies | |
run: pnpm install | |
- name: Code Linting | |
run: pnpm lint | |
unit-testing: | |
name: Unit testing | |
runs-on: ubuntu-latest | |
needs: cache-and-install | |
steps: | |
- name: Code Checkout | |
uses: actions/checkout@v4 | |
- name: Install pnpm v${{ env.PNPM_VERSION }} | |
uses: pnpm/action-setup@v3 | |
with: | |
version: ${{ env.PNPM_VERSION }} | |
run_install: false | |
- name: Install NodeJS v${{ env.NODE_VERSION }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
cache: pnpm | |
- name: Install dependencies | |
run: pnpm install | |
- name: Run unit tests | |
run: pnpm test:unit | |
regression-testing: | |
name: Regrassion testing | |
runs-on: ubuntu-latest | |
needs: cache-and-install | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install pnpm v${{ env.PNPM_VERSION }} | |
uses: pnpm/action-setup@v3 | |
with: | |
version: ${{ env.PNPM_VERSION }} | |
run_install: false | |
- name: Install Node.js v${{ env.NODE_VERSION }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
cache: pnpm | |
- name: Install dependencies | |
run: pnpm install | |
- name: Publish to Chromatic | |
uses: chromaui/action@latest | |
with: | |
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} | |
buildScriptName: storybook:build | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
needs: [linting, unit-testing, regression-testing] | |
steps: | |
- name: Code Checkout | |
uses: actions/checkout@v4 | |
- name: Install pnpm v${{ env.PNPM_VERSION }} | |
uses: pnpm/action-setup@v3 | |
with: | |
version: ${{ env.PNPM_VERSION }} | |
run_install: false | |
- name: Install NodeJS v${{ env.NODE_VERSION }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
cache: pnpm | |
- name: Install dependencies | |
run: pnpm install | |
- name: Create build | |
run: pnpm build |