Skip to content

Merge pull request #92 from OpenSourcePolitics/feat/custom_proposals_… #312

Merge pull request #92 from OpenSourcePolitics/feat/custom_proposals_…

Merge pull request #92 from OpenSourcePolitics/feat/custom_proposals_… #312

Workflow file for this run

name: "CI/CD"
on: [ push ]
env:
CI: "true"
SIMPLECOV: "true"
RUBY_VERSION: 2.7.1
RAILS_ENV: test
NODE_VERSION: 16.9.1
RUBYOPT: '-W:no-deprecated'
RSPEC_FORMATTER: 'documentation'
jobs:
lint:
name: Lint code
runs-on: ubuntu-latest
if: "!startsWith(github.head_ref, 'chore/l10n')"
timeout-minutes: 60
steps:
- uses: rokroskar/[email protected]
if: "github.ref != 'refs/heads/develop'"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- uses: OpenSourcePolitics/lint-action@master
tests:
name: Tests
runs-on: ubuntu-latest
services:
postgres:
image: postgres:11
ports: [ "5432:5432" ]
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
POSTGRES_PASSWORD: postgres
env:
DATABASE_USERNAME: postgres
DATABASE_PASSWORD: postgres
DATABASE_HOST: localhost
RAILS_ENV: test
# Set locales available for i18n tasks
ENFORCED_LOCALES: "en"
steps:
- uses: rokroskar/[email protected]
if: "github.ref != 'refs/heads/master' || github.ref != 'refs/heads/develop'"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- uses: OpenSourcePolitics/rspec-action@master
with:
command: 'bundle exec rspec --exclude-pattern "spec/system/**/*_spec.rb"'
prepare_command: "bundle exec rails db:create db:migrate"
system_tests:
name: System tests
runs-on: ubuntu-latest
services:
postgres:
image: postgres:11
ports: [ "5432:5432" ]
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
POSTGRES_PASSWORD: postgres
env:
DATABASE_USERNAME: postgres
DATABASE_PASSWORD: postgres
DATABASE_HOST: localhost
RAILS_ENV: test
# Set locales available for i18n tasks
ENFORCED_LOCALES: "en"
TRANSLATION_MODE: "smartling"
steps:
- uses: rokroskar/[email protected]
if: "github.ref != 'refs/heads/master' || github.ref != 'refs/heads/develop'"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- uses: OpenSourcePolitics/rspec-action@master
with:
command: 'bundle exec rspec "spec/system"'
prepare_command: "bundle exec rails db:create db:migrate"
push_to_code_commit:
needs: [ tests, lint, system_tests ]
name: Push to CodeCommit
runs-on: ubuntu-latest
if: "github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop'"
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Push to CodeCommit
run: |
git push "https://${{ secrets.NYC_AWS_ACCESS_KEY_ID }}:${{ secrets.NYC_AWS_SECRET_ACCESS_KEY }}@git-codecommit.${{ vars.NYC_CODE_COMMIT_AWS_REGION }}.amazonaws.com/v1/repos/${{ vars.NYC_CODE_COMMIT_REPO_NAME }}" ${{ github.ref }}