mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-10 11:10:54 +00:00
Add turbo caching to GH actions workflows
This commit is contained in:
parent
6f2613cc5c
commit
0362e65bd4
22
.github/workflows/build.yml
vendored
22
.github/workflows/build.yml
vendored
@ -2,9 +2,6 @@ name: build
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
env:
|
||||
HUSKY: 0
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Build, lint, and test on Node.js ${{ matrix.node }}
|
||||
@ -12,22 +9,35 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
node: [14.x, 16.x]
|
||||
node: [14, 16]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Setup Node.js ${{ matrix.node }}
|
||||
uses: actions/setup-node@v1
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
cache: npm
|
||||
|
||||
- name: Install npm@v7
|
||||
run: npm install -g npm@7
|
||||
|
||||
- name: Install dependencies and build packages
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
# Running this after `npm ci` because `npm ci` removes `node_modules`:
|
||||
- name: Download Turborepo cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: node_modules/.cache/turbo
|
||||
key: ${{ runner.os }}-node-${{ matrix.node }}-turbo-${{ hashFiles('node_modules/.cache/turbo') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-${{ matrix.node }}-turbo-
|
||||
|
||||
- name: Build packages
|
||||
run: npm run build
|
||||
|
||||
# TODO setup linting
|
||||
# - name: Lint
|
||||
# run: npm run lint
|
||||
|
21
.github/workflows/release.yml
vendored
21
.github/workflows/release.yml
vendored
@ -1,8 +1,5 @@
|
||||
name: release
|
||||
|
||||
env:
|
||||
HUSKY: 0
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
@ -21,14 +18,26 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Setup Node.js 16.x
|
||||
- name: Setup Node.js 16
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16.x
|
||||
node-version: 16
|
||||
cache: npm
|
||||
|
||||
- name: Install dependencies and build packages
|
||||
- name: Install dependencies
|
||||
run: npm install
|
||||
|
||||
- name: Download Turborepo cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: node_modules/.cache/turbo
|
||||
key: ${{ runner.os }}-node-16-turbo-${{ hashFiles('node_modules/.cache/turbo') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-16-turbo-
|
||||
|
||||
- name: Build packages
|
||||
run: npm run build
|
||||
|
||||
- name: Run tests
|
||||
run: npm run test -- --ci --maxWorkers=2
|
||||
env:
|
||||
|
@ -9,7 +9,7 @@
|
||||
"test:watch": "npm test -- --watch",
|
||||
"build": "turbo run build",
|
||||
"build:archive": "gulp createCoreDistArchive",
|
||||
"prepare": "husky install && npm run build",
|
||||
"prepare": "node -e 'process.exit(!process.env.CI)' || (husky install && npm run build)",
|
||||
"tsc": "turbo tsc",
|
||||
"changeset": "changeset",
|
||||
"release": "changeset publish"
|
||||
@ -47,6 +47,7 @@
|
||||
},
|
||||
"turbo": {
|
||||
"baseBranch": "origin/main",
|
||||
"npmClient": "npm",
|
||||
"pipeline": {
|
||||
"build": {
|
||||
"dependsOn": [
|
||||
|
Loading…
Reference in New Issue
Block a user