A custom action to use in node applications.
The jobs of github actions don't give support to reuse steps between them, so the alternative is build a composite action to reuse on every steps. Instead to write 4 or 5 steps in every jobs of your pipeline you cand just use this custom action.
- use
actions/setup-node@v3
; - does application checkout using
actions/checkout@v3
; - create a
.npmrc
file in case you passnpm-token
parameter; - run
npm install
.
npm-token
: Used to create.npmrc
file in case you have some private dependency
There no outputs yet.
name: Some API
on: [push]
jobs:
linter:
timeout-minutes: 10
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
steps:
- name: Setup application
uses: catho/catho-node-composite-action@v2
with:
npm-token: you npm token
working-directory: ./
- name: Run linter
run: npm run lint
tests:
timeout-minutes: 10
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
steps:
- name: Setup application
uses: catho/catho-node-composite-action@v2
- name: Run all tests
run: npm run test