-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewrite github actions to use reusable workflows
Also use docker image on staging deploy
- Loading branch information
Showing
8 changed files
with
353 additions
and
317 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,16 @@ | ||
name: Lint | ||
|
||
on: | ||
- pull_request | ||
workflow_call: | ||
inputs: | ||
command: | ||
type: string | ||
required: true | ||
|
||
jobs: | ||
bundler-audit: | ||
name: 'Lint: Bundler Audit' | ||
rubocop: | ||
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 | ||
- name: Execute linter | ||
run: docker run --rm gmmcal/gmmcal:test ${{ inputs.command }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
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 |
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
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
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