This file contains hidden or 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] 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" |