feat: added overtime reductions #277
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: π§ͺ Test and π Release | |
on: | |
push: | |
branches: | |
- main | |
- beta | |
pull_request: {} | |
jobs: | |
test-and-release: | |
runs-on: ubuntu-latest | |
if: "!contains(github.event.head_commit.message, '[skip ci]')" | |
strategy: | |
matrix: | |
node-version: [ 16.x, 18.x, 19.x ] | |
concurrency: | |
group: ${{ github.ref }}-node-${{ matrix.node-version }} | |
cancel-in-progress: true | |
steps: | |
- name: β¬οΈ Checkout repo | |
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # pin@v3 | |
- name: β Setup node ${{ matrix.node-version }} | |
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # pin@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: "npm" | |
- name: π Cache node_modules | |
id: cache-node_modules | |
uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # pin@v3 | |
with: | |
path: "**/node_modules" | |
key: node_modules-${{ runner.os }}-node-${{ matrix.node-version }}-${{ | |
hashFiles('**/package-lock.json') }} | |
- name: π Cache .eslintcache | |
uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # pin@v3 | |
with: | |
path: .eslintcache | |
key: eslintcache-${{ runner.os }}-node-${{ matrix.node-version }}-${{ | |
hashFiles('**/package-lock.json') }} | |
- name: π₯ Install dependencies | |
if: steps.cache-node_modules.outputs.cache-hit != 'true' | |
run: | | |
npm ci --ignore-scripts | |
- name: π§ͺ Test | |
run: | | |
npm test | |
env: | |
CI: true | |
CLOCKODO_USER: ${{ secrets.CLOCKODO_USER }} | |
CLOCKODO_API_KEY: ${{ secrets.CLOCKODO_API_KEY }} | |
- name: β¬οΈ Upload coverage report | |
uses: coverallsapp/github-action@9ba913c152ae4be1327bfb9085dc806cedb44057 # [email protected] | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
# - RELEASE --------------------------------------------------------------------------------------- | |
- name: π Release on npm | |
if: "contains(' refs/heads/main refs/heads/beta ', github.ref) && | |
matrix.node-version == '18.x'" | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
npm run release |