Skip to content

A4.3

A4.3 #32

name: "[CI] Continuous Integration"
# Quando vamos rodar?
on:
pull_request:
types: [opened, synchronize]
# Variáveis reusáveis do projeto
env:
NODE_VERSION: 20.14.0
# Quais tarefas queremos executar?
jobs:
# Tarefa
lint:
runs-on: ubuntu-latest
steps:
# [Common CI/CD Setup]
- uses: actions/checkout@v3
with:
fetch-depth: 2
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
cache-dependency-path: ./package-lock.json
# ====================
- name: "Install Dependencies"
run: "npm ci --prefer-offline"
- name: "Lint"
run: "npm run lint"
# Tarefa
test:
runs-on: ubuntu-latest
steps:
# [Common CI/CD Setup]
- uses: actions/checkout@v3
with:
fetch-depth: 2
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
cache-dependency-path: ./package-lock.json
# ====================
- name: "Install Dependencies"
run: "npm ci --prefer-offline"
- name: "Test"
run: "npm run test-changed"