Files
bot-whatsapp/.github/workflows/ci.yml
Leifer Mendez 82a99b2c80 fix(cli): refactor
2023-01-16 10:12:00 +01:00

115 lines
3.4 KiB
YAML

name: Build and Test
on:
pull_request:
branches:
- dev
jobs:
############ BUILD PACKAGE ############
build-package:
name: Build Package
runs-on: ubuntu-latest
needs:
- test-unit
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'yarn'
registry-url: https://registry.npmjs.org/
- run: corepack enable
- name: Install NPM Dependencies
run: yarn install --immutable --network-timeout 300000
- name: Build Package
run: yarn build:full
- name: Build Eslint rules
run: yarn lint:fix
############ UNIT TEST ############
test-unit:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'yarn'
registry-url: https://registry.npmjs.org/
- run: corepack enable
- name: Install NPM Dependencies
run: yarn install --immutable --network-timeout 300000
- name: Unit Tests
run: yarn test
############ UNIT TEST ############
check-providers:
name: Check Providers Versions
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{github.event.after}}
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'yarn'
registry-url: https://registry.npmjs.org/
- run: corepack enable
- name: Install NPM Dependencies
run: yarn install --immutable --network-timeout 300000
- name: Check Baileys
run: yarn node ./scripts/checker.js --name=baileys --stable=true
- name: Check Venom
run: yarn node ./scripts/checker.js --name=venom --stable=true
- name: Check web-whatsapp
run: yarn node ./scripts/checker.js --name=web-whatsapp --stable=true
- name: Check Meta
run: yarn node ./scripts/checker.js --name=meta --stable=true
- name: Check Twilio
run: yarn node ./scripts/checker.js --name=twilio --stable=true
- name: Get Commit Message
run: |
MSG=$(git log --format=%B -n 1 ${{github.event.after}})
echo "::set-env name=COMMIT_MESSAGE::${MSG}"
- name: Add and commit changes to gh-pages branch
run: |
git config --local user.email 'action@github.com'
git config --local user.name 'GitHub Action'
git add .
git commit -m '"${{env.COMMIT_MESSAGE}}"'
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: feature/providers-major