Merge pull request #50 from antoniovazquezblanco/dependabot/npm_and_y… #210
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Main workflow | |
on: [push, pull_request] | |
jobs: | |
run: | |
name: Run | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
- name: Install | |
run: npm install | |
- name: Lint | |
run: npm run format-check | |
- name: Build | |
run: npm run build | |
- name: Test | |
run: npm test | |
- name: Upload coverage | |
uses: ArtiomTr/[email protected] | |
continue-on-error: true | |
with: | |
test-script: npm test | |
- name: Check build status | |
run: git diff --exit-code --quiet && echo "No changes were found :)" || { git --no-pager diff; echo -e "Changes found after build.\nPlease run \"npm run build\" and commit the changes in the dist directory."; exit 1; } | |
release: | |
needs: run | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: Release | |
uses: ncipollo/release-action@v1 | |
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/v') | |
with: | |
allowUpdates: true |