Skip to content

Commit

Permalink
configuring github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
masylum committed Jun 28, 2024
1 parent 74ebdab commit 46573b5
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 26 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: CI/CD

on:
push:
branches:
- '**' # This will trigger the workflow on all branches
pull_request:
branches:
- '**'

jobs:
test:
uses: ./.github/workflows/test.yml

publish:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest

steps:
- name: Tests
uses: ./.github/workflows/common.yml

- name: Publish package
run: npx jsr publish
26 changes: 0 additions & 26 deletions .github/workflows/node.js.yml

This file was deleted.

33 changes: 33 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Test

on:
workflow_call:

jobs:
common:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x, 18.x, 20.x]

steps:
- uses: actions/checkout@v4

- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Run Linter
run: npm run lint

- name: Run Tests
run: npm run test

- name: Run Prettier
run: npm run prettier

0 comments on commit 46573b5

Please sign in to comment.