Add prettier to ci #36
Workflow file for this run
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
# This workflow will do a clean install of node dependencies, prettify the source code, build the source code and run tests across different versions of node | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | |
name: Continuous Integration | |
# Trigger | |
on: [push, pull_request] | |
jobs: | |
build: | |
# OS | |
runs-on: ubuntu-latest | |
# Node.js versions | |
strategy: | |
max-parallel: 1 | |
matrix: | |
node-version: [18.x, 20.x] | |
steps: | |
# Checkout | |
- uses: actions/checkout@v4 | |
# Setup | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Prettify code | |
uses: creyD/[email protected] | |
with: | |
prettier_options: --write . | |
# Install | |
- run: yarn install | |
# Tests | |
- run: npm test | |
- run: npm run test-functional | |
# Yarn cache | |
- name: Get yarn cache directory path | |
id: yarn-cache-dir-path | |
run: echo "::set-output name=dir::$(yarn cache dir)" | |
- uses: actions/cache@v3 | |
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) | |
with: | |
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- |