Add chromatic testing (#170)

This commit is contained in:
Charles Bochet
2023-06-01 11:20:05 +02:00
committed by GitHub
parent e8f1146ae1
commit 51790d8484
6 changed files with 2403 additions and 11 deletions

43
.github/workflows/ci-chromatic.yaml vendored Normal file
View File

@ -0,0 +1,43 @@
name: 'CI Chromatic'
on:
push:
jobs:
chromatic-deployment:
runs-on: ubuntu-latest
env:
REACT_APP_API_URL: http://127.0.0.1:3000/graphql
REACT_APP_AUTH_URL: http://127.0.0.1:3000/auth
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "18"
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Front / Write .env
run: |
cd front
touch .env
echo "REACT_APP_API_URL: $REACT_APP_API_URL" >> .env
echo "REACT_APP_AUTH_URL: $REACT_APP_AUTH_URL" >> .env
- name: Front / Install Dependencies
run: cd front && npm install
- name: Publish to Chromatic
uses: chromaui/action@v1
with:
workingDir: ./front
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}