Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions .github/workflows/node.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Checking code

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
setup:
if: github.event.pull_request.draft != true
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc

- name: Cache node_modules
uses: actions/cache@v3
id: node_modules_cache
with:
key: node_modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
path: node_modules

- run: yarn install --frozen-lockfile --non-interactive
if: steps.node_modules_cache.outputs.cache-hit != 'true'
- run: yarn install-peers
if: steps.node_modules_cache.outputs.cache-hit != 'true'
- name: Ensure project is clean
uses: numtide/clean-git-action@v1
if: steps.cache-node_modules.outputs.cache-hit != 'true'

build:
if: github.event.pull_request.draft != true
needs: setup
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc

- name: Cache node_modules
uses: actions/cache@v3
id: use_node_modules
with:
key: node_modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
path: node_modules
- run: yarn build
- name: Ensure project is clean
uses: numtide/clean-git-action@v1

publish-dry-run:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO we should only publish in case we add a git tag to commit and not on every merge/release.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point! I'll change this job to run when a git tag is pushed

if: github.event.pull_request.draft != true
needs: build
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
- name: Cache node_modules
uses: actions/cache@v3
id: use_node_modules
with:
key: node_modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
path: node_modules

- name: publish --dry-run
run: npm publish --dry-run

1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
16.13.1