gh: Project Structure refactor #2
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
name: PR Tests | |
on: | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
dependencies: | |
runs-on: ubuntu-latest | |
container: | |
image: node:18 | |
strategy: | |
matrix: | |
node-version: [18.x] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Cache node modules | |
uses: actions/cache@v1 | |
with: | |
path: node_modules | |
key: node_modules-${{ hashFiles('**/yarn.lock') }} | |
- name: Install yarn | |
run: npm install -g yarn | |
- name: Install dependencies | |
run: yarn install | |
lint: | |
runs-on: ubuntu-latest | |
needs: dependencies | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Load node modules | |
uses: actions/cache@v1 | |
with: | |
path: node_modules | |
key: node_modules-${{ hashFiles('**/yarn.lock') }} | |
- name: Code passes lint check | |
run: yarn lint | |
test: | |
runs-on: ubuntu-latest | |
needs: dependencies | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Load node modules | |
uses: actions/cache@v1 | |
with: | |
path: node_modules | |
key: node_modules-${{ hashFiles('**/yarn.lock') }} | |
- name: Create mock .env file | |
run: | | |
cp .env.test .env | |
- name: All Tests pass | |
run: yarn test |