Add Codecov #102
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: Build and Test | |
on: | |
push: | |
branches: | |
- production | |
pull_request: | |
branches: | |
- production | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
registry-url: 'https://registry.npmjs.org' | |
- name: Install PNPM | |
uses: pnpm/action-setup@v3 | |
with: | |
version: 8 | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Git and update production branch | |
run: | | |
git config --global user.name "GitHub Actions" | |
git config --global user.email "actions@github.com" | |
git fetch | |
git checkout production | |
git pull --no-rebase | |
- name: Setup GitHub Pages | |
uses: actions/configure-pages@v3 | |
- name: Install dependencies | |
run: pnpm install --no-frozen-lockfile | |
- name: Build | |
run: pnpm build | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v4.0.1 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
slug: isakhauge/nanosplash | |
- name: Test | |
run: pnpm test | |
- name: Generate Code Coverage | |
run: pnpm coverage | |
#- name: Commit and push changes | |
# run: | | |
# git add . | |
# git commit --allow-empty -m "Build, test, and coverage report" | |
# git push | |
#- name: Publish to NPM | |
# run: npm publish | |
# env: | |
# NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} |