docs: add NPM package version badge #13
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: trunk | |
concurrency: trunk | |
on: | |
push: | |
branches: [main] | |
jobs: | |
# https://github.jparrowsec.cnmunity/t/how-can-i-test-if-secrets-are-available-in-an-action/17911/10 | |
checkNpmTokenSet: | |
name: Check if NPM_TOKEN secret is set | |
runs-on: ubuntu-latest | |
outputs: | |
isNpmTokenSet: ${{ steps.checkNpmTokenSet.outputs.isNpmTokenSet }} | |
steps: | |
- name: Check if NPM_TOKEN secret is set | |
id: checkNpmTokenSet | |
run: | | |
echo "isNpmTokenSet: ${{secrets.NPM_TOKEN != ''}}" | |
echo "::set-output name=isNpmTokenSet::${{secrets.NPM_TOKEN != ''}}" | |
test: | |
name: Run tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
- name: Setup environment, cache, and dependencies | |
uses: ./.github/actions/setup | |
- name: Build library | |
run: pnpm build | |
- name: Run tests | |
run: pnpm test | |
test-coverage: | |
name: Run tests and collect coverage | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup environment, cache, and dependencies | |
uses: ./.github/actions/setup | |
- name: Run tests with coverage | |
run: pnpm test:coverage | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v2 | |
with: | |
token: ${{secrets.CODECOV_TOKEN}} | |
# TODO re-enable when I get DripIP working | |
# release-canary: | |
# needs: [checkNpmTokenSet] | |
# if: needs.checkNpmTokenSet.outputs.isNpmTokenSet == 'true' | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: prisma-labs/dripip@master | |
# with: | |
# npmToken: ${{secrets.NPM_TOKEN}} | |
# githubToken: ${{secrets.GITHUB_TOKEN}} |