Skip to content

Merge branch 'stable' into adr-0003-warehouse-frontend-modernization #3371

Merge branch 'stable' into adr-0003-warehouse-frontend-modernization

Merge branch 'stable' into adr-0003-warehouse-frontend-modernization #3371

name: Rebuild Test Kit Fixpoints
on:
push:
branches:
- "*"
- "**/*"
concurrency:
group: ${{ github.ref }}-test_kit_fixpoints
cancel-in-progress: true
jobs:
tests:
runs-on: ubuntu-20.04
if: contains(github.event.head_commit.message, '[gh:rebuild_fixpoints]')
# Docker Hub image that the job executes in
# $RUBY_VERSION
container: ruby:3.1.6-alpine3.20
# Service containers to run with job
services:
postgres:
image: postgis/postgis:16-3.4-alpine
env:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_PASS: postgres
POSTGRES_MULTIPLE_EXTENSIONS: postgis,hstore
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
redis:
image: redis:alpine
ports:
- 6379:6379
hmis-warehouse-sftp:
image: ghcr.io/greenriver/openpath-sftp:1.0
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
ports:
- '2222:22'
minio:
image: ghcr.io/greenriver/openpath-minio:1.0
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
env:
MINIO_ACCESS_KEY: local_access_key
MINIO_SECRET_KEY: local_secret_key
ports:
- '9000:9000'
env:
CLIENT: test
DATABASE_ADAPTER: postgresql
DATABASE_APP_DB_TEST: warehouse_app_test
DATABASE_DB_TEST: warehouse_test
DATABASE_APP_DB: warehouse_app_test
DATABASE_HOST: postgres
DATABASE_PASS: postgres
DATABASE_USER: postgres
DATABASE_WAREHOUSE_DB_TEST: warehouse_test
DEFAULT_FROM: greenriver.testing@mailinator.com
ENCRYPTION_KEY: strongEncryptionstrongEncryptionstrongEncryption
FQDN: openpath.host
HEALTH_DATABASE_ADAPTER: postgresql
HEALTH_DATABASE_DB_TEST: health_test
HEALTH_DATABASE_HOST: postgres
HEALTH_DATABASE_PASS: postgres
HEALTH_DATABASE_USER: postgres
HEALTH_FROM: greenriver.testing@mailinator.com
HOSTNAME: openpath.host
MINIO_ENDPOINT: http://minio:9000
USE_MINIO_ENDPOINT: true
PORT: 80
RAILS_ENV: test
REPORTING_DATABASE_ADAPTER: postgresql
REPORTING_DATABASE_DB_TEST: reporting_test
REPORTING_DATABASE_HOST: postgres
REPORTING_DATABASE_PASS: postgres
REPORTING_DATABASE_USER: postgres
WAREHOUSE_DATABASE_ADAPTER: postgis
WAREHOUSE_DATABASE_DB_TEST: warehouse_test
WAREHOUSE_DATABASE_HOST: postgres
WAREHOUSE_DATABASE_PASS: postgres
WAREHOUSE_DATABASE_USER: postgres
WAREHOUSE_DATABASE_DB: warehouse_test
HEALTH_DATABASE_DB: health_test
REPORTING_DATABASE_DB: reporting_test
# Tell Puppeteer to skip installing Chrome. We'll be using the installed package.
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true
PUPPETEER_EXECUTABLE_PATH: /usr/bin/chromium-browser
steps:
- name: Checkout
uses: actions/checkout@v4
- name: 'Container Setup'
id: container-setup
uses: ./.github/workflows/container_setup
- name: 'App setup'
run: |
cp config/secrets.yml.sample config/secrets.yml
mkdir app/assets/stylesheets/theme/styles
touch app/assets/stylesheets/theme/styles/_variables.scss
cp .rspec.sample .rspec
cp config/database.yml.ci config/database.yml
- name: Prepare test db
run: |
pg_isready -h postgres -U postgres
bin/db_prep
echo "Setting up .pgpass"
echo "postgres:*:*:postgres:postgres" > ~/.pgpass
chmod 600 ~/.pgpass
# fetch some closed source files
- name: 'Fetch testkit source files'
uses: keithweaver/aws-s3-github-action@v1.0.0
with:
command: cp
source: ${{ secrets.AWS_S3_ACTION_BUCKET }}${{ vars.AWS_S3_ACTIONS_SOURCE_PATH_FY_2024 }}
destination: ./drivers/datalab_testkit/spec/fixtures/inputs/
aws_access_key_id: ${{ secrets.AWS_S3_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_S3_SECRET_ACCESS_KEY }}
aws_region: us-east-1
flags: --recursive
- name: Generate new fixpoint files
env:
AWS_ACCESS_KEY_ID: local_access_key
AWS_SECRET_ACCESS_KEY: local_secret_key
GROVER_NO_SANDBOX: true
CHROMIUM_PATH: /usr/bin/chromium-browser
MAX_FAILURES: 60
LOG_LEVEL: INFO
run: |
bundle exec rspec --fail-fast=$MAX_FAILURES --color -P "drivers/datalab_testkit/spec/empty_spec.rb"
- name: Get current date
id: date
run: echo "today=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: 'Copy old fixpoints to previous folder'
uses: keithweaver/aws-s3-github-action@v1.0.0
with:
command: cp
source: ${{ secrets.AWS_S3_ACTION_BUCKET }}${{ vars.AWS_S3_ACTIONS_FIXPOINT_PATH_FY_2024 }}
destination: ${{ secrets.AWS_S3_ACTION_BUCKET }}${{ vars.AWS_S3_ACTIONS_PREVIOUS_FIXPOINT_PATH_FY_2024 }}${{ env.today }}/
aws_access_key_id: ${{ secrets.AWS_S3_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_S3_SECRET_ACCESS_KEY }}
aws_region: us-east-1
flags: --recursive
- name: 'Copy new fixpoint files to current folder'
uses: keithweaver/aws-s3-github-action@v1.0.0
with:
command: cp
source: ./drivers/datalab_testkit/spec/fixpoints/
destination: ${{ secrets.AWS_S3_ACTION_BUCKET }}${{ vars.AWS_S3_ACTIONS_FIXPOINT_PATH_FY_2024 }}
aws_access_key_id: ${{ secrets.AWS_S3_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_S3_SECRET_ACCESS_KEY }}
aws_region: us-east-1
flags: --recursive