Merge pull request #78 from jpgoelz/main #104
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 | |
on: | |
push: | |
branches: | |
- master | |
- staging | |
pull_request: | |
jobs: | |
build: | |
name: Build and test on node ${{ matrix.node }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node: ['14', '16'] | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: '0' | |
- name: Setup pnpm | |
uses: pnpm/[email protected] | |
with: | |
version: 7 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node }} | |
registry-url: 'https://registry.npmjs.org' | |
cache: 'pnpm' | |
- name: Install dependencies | |
shell: bash | |
run: pnpm install --frozen-lockfile | |
- name: Build | |
run: pnpm build | |
- name: Run Lint and Tests | |
run: pnpm test:full | |
release: | |
name: Release | |
needs: build | |
if: github.event_name == 'push' && github.ref == 'refs/heads/master' | |
runs-on: ubuntu-latest | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: '0' | |
- name: Setup pnpm | |
uses: pnpm/[email protected] | |
with: | |
version: 7 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
registry-url: 'https://registry.npmjs.org' | |
cache: 'pnpm' | |
- name: Install dependencies | |
shell: bash | |
run: pnpm install --frozen-lockfile | |
- name: Build | |
run: pnpm build | |
- name: Run Lint and Tests | |
run: pnpm test:full | |
- name: Upload coverage reports of auto-spies-core | |
uses: codecov/codecov-action@v1 | |
with: | |
file: ./packages/auto-spies-core/coverage/lcov.info | |
flags: auto-spies-core | |
- name: Upload coverage reports of jasmine-auto-spies | |
uses: codecov/codecov-action@v1 | |
with: | |
file: ./packages/jasmine-auto-spies/coverage/lcov.info | |
flags: jasmine-auto-spies | |
- name: Upload coverage reports of jest-auto-spies | |
uses: codecov/codecov-action@v1 | |
with: | |
file: ./packages/jest-auto-spies/coverage/lcov.info | |
flags: jest-auto-spies | |
- name: Configure CI Git User | |
run: | | |
git config --global user.name '@hirezio' | |
git config --global user.email '[email protected]' | |
- name: Update Version | |
run: pnpm lerna:version:ci | |
- name: Check Authentication with Registry | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
shell: bash | |
run: npm whoami | |
- name: Publish to npm | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: pnpm lerna:publish |