Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract workflows from build job to new lint and test jobs #1

Merged
merged 8 commits into from
Apr 17, 2024
30 changes: 0 additions & 30 deletions .github/workflows/build.yml

This file was deleted.

57 changes: 57 additions & 0 deletions .github/workflows/development.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Development

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
workflow_call:

jobs:
build-test:
name: Build and test
runs-on: ubuntu-latest
steps:
- name: "Checkout repository"
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: "Setup Node"
uses: actions/setup-node@v3
with:
node-version: latest

- name: "Install dependencies"
run: npm ci

- name: "Build"
run: |
npm run bundle
npm run bundle-min

- name: "Run tests"
run: npm test

lint:
name: Code standards
runs-on: ubuntu-latest
steps:
- name: "Checkout repository"
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: "Setup Node"
uses: actions/setup-node@v3
with:
node-version: latest

- name: "Install dependencies"
run: npm ci

- name: "Lint code"
run: npm run lint

- name: "Lint commit"
run: npm run commitlint
40 changes: 0 additions & 40 deletions .github/workflows/npm-publish.yml

This file was deleted.

34 changes: 34 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Release

on:
push:
branches: [ "master" ]

jobs:
build-test-lint:
name: Build, test, and lint
uses: d3fc/d3fc/.github/workflows/development.yml@main

publish-npm:
name: Publish npm package(s)
needs: build-test-lint
runs-on: ubuntu-latest
steps:
- name: "Checkout repository"
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: "Setup Node"
uses: actions/setup-node@v3
with:
node-version: latest
registry-url: https://registry.npmjs.org/

- name: "Install dependencies"
run: npm ci

- name: "Publish"
run: npm run publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
Loading