mirror of
https://github.com/amark/gun.git
synced 2026-03-11 11:15:10 +00:00
* no artifacts, not required * renamed * cleanup and comments * pass build args * two-step docker build
63 lines
1.4 KiB
YAML
63 lines
1.4 KiB
YAML
name: ci
|
|
|
|
on:
|
|
- push
|
|
- pull_request
|
|
|
|
env:
|
|
project: 'gun'
|
|
|
|
jobs:
|
|
|
|
test:
|
|
strategy:
|
|
matrix:
|
|
node-version: [ 14.x ]
|
|
os: [ ubuntu-latest ]
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
|
|
# checkout the code
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
|
|
# verify the version in package.json matches the release tag
|
|
- name: Version
|
|
uses: tcurdt/action-verify-version-npm@master
|
|
|
|
# setup the node version
|
|
- name: Setup Node ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v1
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
|
|
# cache node_modules if we can
|
|
- name: Cache
|
|
id: cache-modules
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: node_modules
|
|
key: ${{ matrix.node-version }}-${{ runner.OS }}-build-${{ hashFiles('package.json') }}
|
|
|
|
# ottherweise run install
|
|
- name: Install
|
|
if: steps.cache-modules.outputs.cache-hit != 'true'
|
|
run: npm install
|
|
|
|
# run tests
|
|
- name: Test
|
|
run: npm test
|
|
|
|
# only create a release for tags named 'v*'
|
|
release:
|
|
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
|
|
needs: [ test ]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
|
|
# create github release (which triggers the release workflows)
|
|
- name: Release
|
|
uses: softprops/action-gh-release@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.PAT }}
|