Merge pull request #28 from p2panda/create-blob-method #104
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: shirokuma | |
on: push | |
env: | |
cache_path: | | |
~/.npm | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node: [16, 17, 18, 19] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup node ${{ matrix.node }} | |
# This action handles node dependency caching for us | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "${{ matrix.node }}" | |
- name: Restore from npm cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.cache_path }} | |
# Note that this caching action does NOT cache node dependencies. | |
# This is done by "actions/setup-node" instead. Here we're caching | |
# npm artifacts. | |
key: ${{ runner.os }}-test-${{ matrix.node }}-${{ hashFiles('**/package-lock.json') }} | |
- name: Install dependencies | |
run: npm ci | |
- name: Run tests | |
run: npm run test --coverage | |
- if: matrix.node == 16 | |
uses: codecov/codecov-action@v2 | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup node | |
# This action also handles dependency caching for us | |
uses: actions/setup-node@v3 | |
with: | |
node-version-file: .nvmrc | |
- name: Restore from npm cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.cache_path }} | |
key: ${{ runner.os }}-build-${{ hashFiles('**/package-lock.json') }} | |
- name: Install dependencies | |
run: npm ci | |
- name: Run build | |
run: npm run build | |
typecheck: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup node | |
# This action also handles dependency caching for us | |
uses: actions/setup-node@v3 | |
with: | |
node-version-file: .nvmrc | |
- name: Restore from npm cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.cache_path }} | |
key: ${{ runner.os }}-tsc-${{ hashFiles('**/package-lock.json') }} | |
- name: Install dependencies | |
run: npm ci | |
- name: Check types | |
run: npm run typecheck |