Skip to content

Commit

Permalink
👷 Update GitHub Actions workflow file
Browse files Browse the repository at this point in the history
  • Loading branch information
TemaSM committed Jan 29, 2023
1 parent 2f8e2d6 commit f244a27
Showing 1 changed file with 23 additions and 16 deletions.
39 changes: 23 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,46 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x, 14.x, 16.x]
node-version: [14, 16, 18]
name: Node.js ${{ matrix.node-version }}
steps:
- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Cache Node.js modules (pnpm)
uses: actions/cache@v2
env:
cache-name: cache-pnpm-modules
- name: Install pnpm
uses: pnpm/action-setup@v2
id: pnpm-install
with:
path: ~/.pnpm-store
key: ${{ runner.OS }}-${{ env.cache-name }}-node-${{ matrix.node-version }}-
restore-keys: |
${{ runner.OS }}-${{ env.cache-name }}-node-${{ matrix.node-version }}-
version: 7
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
# pnpm much faster and better than npm & yarn, check it out: https://pnpm.io/
- uses: pnpm/action-setup@v2.0.1
- name: Setup pnpm cache
uses: actions/cache@v3
with:
version: 6.7.2
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-node-${{ matrix.node-version }}
restore-keys: |
${{ runner.os }}-pnpm-store-node-${{ matrix.node-version }}
- name: Install dependencies
run: pnpm install

# Here we will use pnpx to run executables, instead of running `npm run <script>` which utilizes npx
- name: Run tests
run: |
pnpx nyc mocha tests --require should
pnpx nyc report --reporter=lcovonly
pnpm run test
pnpm run coverage
timeout-minutes: 5

- name: Coveralls
Expand Down

0 comments on commit f244a27

Please sign in to comment.