Skip to content

Commit

Permalink
test: add gh action for tests and test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
bandantonio committed May 5, 2024
1 parent eda8f3b commit 587c8a6
Show file tree
Hide file tree
Showing 7 changed files with 2,615 additions and 1,025 deletions.
30 changes: 26 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [push]
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

jobs:
node-setup:
name: ⚙️ Setup Node.js
Expand Down Expand Up @@ -33,17 +33,39 @@ jobs:
id: linter
run: npm run lint

run-tests:
name: 🧪 Tests
needs: node-setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/node-cache
id: cache-node-modules
with:
node-version: '20'

- name: 🧪 Run tests
id: tests
run: npm run coverage

- name: 📈 Send test coverage to Coveralls
id: coverage
if: steps.tests.outcome == 'success'
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

release-plugin:
name: 📦 Release Obsidian Plugin
needs: run-lint
needs: [run-lint, run-tests]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/node-cache
id: cache-node-modules
with:
node-version: '20'

- name: 📗 Build plugin
id: build_plugin
if: steps.cache-node-modules.outcome == 'success'
Expand All @@ -58,4 +80,4 @@ jobs:
files: |
main.js
manifest.json
styles.css
styles.css
Loading

0 comments on commit 587c8a6

Please sign in to comment.