Trying matrix for working directory

This commit is contained in:
Pavel Murygin 2022-02-21 16:19:29 +03:00
parent b7059ed863
commit 75aebb47fc
2 changed files with 12 additions and 42 deletions

View File

@ -1,4 +1,4 @@
name: Run tests for "browser to browser example"
name: Run tests for js-based projects
on:
push:
@ -6,13 +6,20 @@ on:
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./quickstart/1-browser-to-browser
strategy:
matrix:
node-version: [16.x]
working-directory: [
"/quickstart/1-browser-to-browser",
"/quickstart/3-browser-to-service",
"/fluence-js-examples/hello-world",
"/fluence-js-examples/browser-example",
"/fluence-js-examples/node-example",
"/aqua-examples/echo-greeter/client-peer",
"/aqua-examples/price-oracle/client-peer",
"/aqua-examples/price-oracle/web"
]
steps:
- uses: actions/checkout@v2
@ -30,6 +37,7 @@ jobs:
node-version: ${{ matrix.node-version }}
- name: run tests
working-directory: ${{ matrix.working-directory }}
env:
CI: true
run: |

View File

@ -1,38 +0,0 @@
name: Run tests for <project name>
on:
push:
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: <path/to/project>
strategy:
matrix:
node-version: [16.x]
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-v1-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-v1-node-${{ matrix.node-version }}
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: run tests
env:
CI: true
run: |
npm i
npm build
npm test