Skip to content

Rewrite github actions to use reusable workflows #4

Rewrite github actions to use reusable workflows

Rewrite github actions to use reusable workflows #4

Workflow file for this run

name: Pipeline
on:
- pull_request
jobs:
build:
name: Build image
uses: gmmcal/gmmcal.com.br/.github/workflows/docker.yml@reusable
rubocop:
name: 'Lint: Rubocop'
uses: gmmcal/gmmcal.com.br/.github/workflows/lint.yml@reusable
with:
command: bundle exec rubocop --config .rubocop.yml .
needs: build
# reek:
# name: 'Lint: Reek'
# runs-on: ubuntu-20.04
# needs: build
# steps:
# - name: Run reek
# run: |
# docker run --rm gmmcal/gmmcal:test bundle exec reek --config .reek.yml .
# brakeman:
# name: 'Lint: Brakeman'
# runs-on: ubuntu-20.04
# needs: build
# steps:
# - name: Run brakeman
# run: |
# docker run --rm gmmcal/gmmcal:test bundle exec brakeman
# scsslint:
# name: 'Lint: SCSSLint'
# runs-on: ubuntu-20.04
# needs: build
# steps:
# - name: Run SCSSLint
# run: |
# docker run --rm gmmcal/gmmcal:test bundle exec scss-lint --config .scss-lint.yml
# tests:
# name: 'Unit: Backend'
# runs-on: ubuntu-20.04
# needs: build
# services:
# postgres:
# image: postgres:16
# env:
# POSTGRES_USER: postgres
# POSTGRES_PASSWORD: postgres
# POSTGRES_DB: gmmcalcombr_test
# ports:
# - 5432:5432
# options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
# steps:
# - name: Run rubocop
# run: |
# docker run --network=${{ job.services.postgres.network }} -e DATABASE_URL='postgres://postgres:postgres@postgres:5432/gmmcalcombr_test' -e DATABASE_CLEANER_ALLOW_REMOTE_DATABASE_URL=true --rm gmmcal/gmmcal:test
# bundler-audit:
# name: 'Lint: Bundler Audit'
# runs-on: ubuntu-20.04
# container:
# image: ruby:3.2.2
# steps:
# - uses: actions/checkout@v3
# - name: Install Bundler Audit
# run: gem install bundler-audit
# - name: Update advisory database
# run: bundler-audit update
# - name: Run bundler-audit
# run: bundler-audit
# eslint:
# name: 'Lint: ESLint'
# runs-on: ubuntu-20.04
# container:
# image: node:18
# steps:
# - uses: actions/checkout@v4
# - name: Get yarn cache directory path
# id: yarn-cache-dir-path
# run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
# - uses: actions/cache@v3
# id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
# with:
# path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
# key: ${{ runner.os }}-yarn-gmmcal-${{ hashFiles('/yarn.lock') }}
# restore-keys: |
# ${{ runner.os }}-yarn-gmmcal-
# - name: Run yarn install
# run: yarn install
# - name: Run ESLint - Application
# run: yarn eslint
# - name: Run ESLint - Tests
# run: yarn eslint:tests