Skip to content

Commit

Permalink
fix: cache
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsimao committed Mar 27, 2023
1 parent 89457f7 commit 34454a7
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 51 deletions.
23 changes: 23 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Setup
description: Sets up a Node.js environment, installs the dependencies using Yarn,
and caches the installed dependencies for faster future builds.
runs:
using: composite
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org
cache: yarn

- uses: actions/cache@v3
id: install-cache
with:
path: node_modules/
key: ${{ runner.os }}-install-${{ hashFiles('**/yarn.lock') }}

- if: steps.install-cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile --ignore-scripts --ignore-engines
shell: bash
16 changes: 4 additions & 12 deletions .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,11 @@ jobs:
runs-on: ubuntu-latest
# Job steps
steps:
# 👇 Version 2 of the action
- name: Checkout repository
uses: actions/checkout@v3
- uses: actions/checkout@v2
with:
fetch-depth: 0 # 👈 Required to retrieve git history
- uses: actions/setup-node@v2
with:
node-version: '16'
- name: Install dependencies
run: yarn
# 👇 Adds Chromatic as a step in the workflow
- name: Publish to Chromatic
uses: chromaui/action@v1
fetch-depth: 0
- uses: ./.github/actions/setup
- uses: chromaui/action@v1
# Chromatic GitHub Action options
with:
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Test

on:
push:
branches:
- master
pull_request:
# manual trigger
workflow_dispatch:

env:
REACT_APP_RELAY_CHAIN_NAME: polkadot
REACT_APP_PARACHAIN_ID: 2032
DOCKER_RELAY_CHAIN_CURRENCY: DOT
REACT_APP_FEATURE_FLAG_LENDING: enabled
REACT_APP_FEATURE_FLAG_AMM: enabled

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup
- run: yarn lint

unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup
- run: yarn test:ci
39 changes: 0 additions & 39 deletions .github/workflows/yarn-test.yml

This file was deleted.

0 comments on commit 34454a7

Please sign in to comment.