Merge pull request #194 from maykon-oliveira/main #415
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: CI | |
on: | |
push: | |
branches: | |
- main | |
- beta | |
pull_request: | |
branches: | |
- "*" | |
jobs: | |
Test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
registry-url: https://registry.npmjs.org | |
- uses: actions/cache@v3 | |
with: | |
path: "**/node_modules" | |
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} | |
- name: Install dependencies 💿 | |
run: yarn install --frozen-lockfile | |
- name: Run Tests 🧪 | |
run: yarn coverage | |
- name: Report coverage 📏 | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
working-directory: ./packages/core | |
flags: core | |
Publish: | |
runs-on: ubuntu-latest | |
needs: | |
- Test | |
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/beta' }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
registry-url: https://registry.npmjs.org | |
- uses: actions/cache@v3 | |
with: | |
path: "**/node_modules" | |
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} | |
- name: Install dependencies 💿 | |
run: yarn install --frozen-lockfile | |
- name: Publish 🚀 | |
run: | | |
rm .npmrc | |
cp ./README.md ./packages/core/README.md | |
yarn run release | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |