Skip to content

improve workflows

improve workflows #53

Workflow file for this run

name: linux
on:
push:
branches:
- main
pull_request:
jobs:
lint:
runs-on: ubuntu-latest
name: Lint
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install Dependencies
run: npm install
- name: Run lint
run: npm run lint
test-alpine:
runs-on: ubuntu-latest
name: Test alpine
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
persist-credentials: false
- run: |
docker build . -t pidusage
docker run -v $(pwd):/var/pidusage pidusage:latest npm install
docker run -v $(pwd):/var/pidusage pidusage:latest npm test
test:
name: Test with Node ${{ matrix.node }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
node:
- 10
- 12
- 14
- 16
- 18
- 20
- 21
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup node ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Install Dependencies
run: npm install
- name: Run tests
run: npm test
coverage:
runs-on: ubuntu-latest
name: Test coverage
steps:
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
- name: Install Dependencies
run: npm install
- name: Run coverage
run: npm run coverage