Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove RAILS_MASTER_KEY from ci #470

Draft
wants to merge 11 commits into
base: staging
Choose a base branch
from
3 changes: 1 addition & 2 deletions .github/workflows/continuous-delivery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,7 @@ jobs:
sha: ${{ needs.merge.outputs.sha }}
secrets:
codecov_token: ${{ secrets.CODECOV_TOKEN }}
rails_master_key: ${{ secrets.RAILS_MASTER_KEY }}


publish_image:
name: Publish Image
needs: [metadata, merge]
Expand Down
41 changes: 28 additions & 13 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ on:
codecov_token:
description: Codecov token
required: true
rails_master_key:
description: The Rails master key
required: true


jobs:
build:
Expand Down Expand Up @@ -76,21 +72,33 @@ jobs:
name: app

- name: Lint
env:
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
run: |
EXIT_STATUS=0
./actionlint -ignore 'property "gh_app_private_key" is not defined' -ignore 'SC2153:' \
-ignore 'property "sha" is not defined in object type {}' || EXIT_STATUS=$?
docker run -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_HOST=localhost -e \
RAILS_MASTER_KEY --network=host app bin/ci.sh lint || EXIT_STATUS=$?
./actionlint \
-ignore 'property "gh_app_private_key" is not defined' \
-ignore 'SC2153:' \
-ignore 'property "sha" is not defined in object type {}' || \
EXIT_STATUS=$?
docker run \
-e POSTGRES_USER=postgres \
-e POSTGRES_PASSWORD=postgres \
-e POSTGRES_HOST=localhost \
--network=host \
app bin/ci.sh lint || \
EXIT_STATUS=$?
exit $EXIT_STATUS

test:
name: Test
runs-on: ubuntu-latest
needs: build
env:
CAMO_KEY: camo_key_123
services:
camo:
image: rx14/camo.cr:latest
env:
PORT: 9090
db:
image: postgres:14.7
env:
Expand Down Expand Up @@ -120,11 +128,18 @@ jobs:

- name: Test
env:
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
CAMO_HOST: localhost:9090
run: |
mkdir coverage
docker run -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_HOST=localhost -e \
RAILS_MASTER_KEY --network=host -v "$(pwd)"'/coverage:/app/coverage' app bin/ci.sh spec
docker run \
-e CAMO_KEY \
-e CAMO_HOST \
-e POSTGRES_USER=postgres \
-e POSTGRES_PASSWORD=postgres \
-e POSTGRES_HOST=localhost \
--network=host \
-v "$(pwd)"'/coverage:/app/coverage' \
app bin/ci.sh spec

- name: Upload coverage report to Codecov
if: ${{ !cancelled() }}
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ gem 'puma', '~> 6.0'
gem 'pundit', '~> 2.4'
gem 'rack-attack', '~> 6.7'
gem 'rack-cors', '~> 2.0', '>= 2.0.2', require: 'rack/cors'
gem 'rails', '~> 7.0', '>= 7.0.4.3'
gem 'rails', '~> 7.1.0'
gem 'rails-i18n', '~> 7.0', '>= 7.0.10'
gem 'redis', '~> 4.8', '>= 4.8.1'
gem 'roo', '~> 2.10', '>= 2.10.1'
Expand Down
Loading
Loading