Merge pull request #65 from ed-software/dependabot/npm_and_yarn/babel… #95
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: 'CI' | |
on: push | |
env: | |
NODE_VERSION: '18.12.1' | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: npm ci | |
- name: Run tests | |
run: npm test | |
- name: Check code format | |
run: npm run prettier:check | |
- name: Check code format | |
run: npm run eslint | |
chromatic-deployment: | |
# Operating System | |
runs-on: ubuntu-latest | |
# Job steps | |
env: | |
HAS_CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Setup Node ${{ env.NODE_VERSION }} Environment | |
uses: actions/setup-node@v2 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
cache: npm | |
- name: Install dependencies | |
if: ${{ env.HAS_CHROMATIC_PROJECT_TOKEN }} | |
# 👇 Install dependencies with the same package manager used in the project (replace it as needed), e.g. yarn, npm, pnpm | |
run: npm ci | |
# 👇 Adds Chromatic as a step in the workflow | |
- name: Publish to Chromatic | |
if: ${{ env.HAS_CHROMATIC_PROJECT_TOKEN }} | |
uses: chromaui/action-next@v1 | |
# Chromatic GitHub Action options | |
with: | |
# 👇 Chromatic projectToken, refer to the manage page to obtain it. | |
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} |