2023-03-06 22:49:43 -05:00
|
|
|
name: Ruby Testing
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2023-03-08 01:12:57 -05:00
|
|
|
branches-ignore:
|
|
|
|
- 'dependabot/**'
|
2023-06-06 04:42:23 -04:00
|
|
|
- 'renovate/**'
|
2023-03-06 22:49:43 -05:00
|
|
|
pull_request:
|
|
|
|
|
|
|
|
env:
|
|
|
|
BUNDLE_CLEAN: true
|
|
|
|
BUNDLE_FROZEN: true
|
|
|
|
|
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
2023-05-05 03:06:51 -04:00
|
|
|
strategy:
|
|
|
|
fail-fast: true
|
|
|
|
matrix:
|
|
|
|
mode:
|
|
|
|
- production
|
|
|
|
- test
|
2023-03-06 22:49:43 -05:00
|
|
|
env:
|
2023-05-05 03:06:51 -04:00
|
|
|
RAILS_ENV: ${{ matrix.mode }}
|
|
|
|
BUNDLE_WITH: ${{ matrix.mode }}
|
|
|
|
OTP_SECRET: precompile_placeholder
|
|
|
|
SECRET_KEY_BASE: precompile_placeholder
|
2023-03-06 22:49:43 -05:00
|
|
|
|
|
|
|
steps:
|
2023-09-11 04:41:26 -04:00
|
|
|
- uses: actions/checkout@v4
|
2023-03-06 22:49:43 -05:00
|
|
|
|
2023-10-24 07:43:24 -04:00
|
|
|
- name: Set up Ruby environment
|
|
|
|
uses: ./.github/actions/setup-ruby
|
2023-03-06 22:49:43 -05:00
|
|
|
|
2023-10-24 07:43:24 -04:00
|
|
|
- name: Set up Javascript environment
|
|
|
|
uses: ./.github/actions/setup-javascript
|
2023-03-06 22:49:43 -05:00
|
|
|
with:
|
2023-10-24 07:43:24 -04:00
|
|
|
onlyProduction: 'true'
|
2023-03-06 22:49:43 -05:00
|
|
|
|
|
|
|
- name: Precompile assets
|
|
|
|
# Previously had set this, but it's not supported
|
|
|
|
# export NODE_OPTIONS=--openssl-legacy-provider
|
|
|
|
run: |-
|
|
|
|
./bin/rails assets:precompile
|
|
|
|
|
|
|
|
- uses: actions/upload-artifact@v3
|
2023-05-05 03:06:51 -04:00
|
|
|
if: matrix.mode == 'test'
|
2023-03-06 22:49:43 -05:00
|
|
|
with:
|
|
|
|
path: |-
|
|
|
|
./public/assets
|
|
|
|
./public/packs-test
|
|
|
|
name: ${{ github.sha }}
|
|
|
|
retention-days: 0
|
|
|
|
|
|
|
|
test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
needs:
|
|
|
|
- build
|
|
|
|
|
|
|
|
services:
|
|
|
|
postgres:
|
2023-03-10 05:10:47 -05:00
|
|
|
image: postgres:14-alpine
|
2023-03-06 22:49:43 -05:00
|
|
|
env:
|
|
|
|
POSTGRES_PASSWORD: postgres
|
|
|
|
POSTGRES_USER: postgres
|
|
|
|
options: >-
|
|
|
|
--health-cmd pg_isready
|
|
|
|
--health-interval 10s
|
|
|
|
--health-timeout 5s
|
|
|
|
--health-retries 5
|
|
|
|
ports:
|
|
|
|
- 5432:5432
|
|
|
|
|
|
|
|
redis:
|
2023-03-10 05:10:47 -05:00
|
|
|
image: redis:7-alpine
|
2023-03-06 22:49:43 -05:00
|
|
|
options: >-
|
|
|
|
--health-cmd "redis-cli ping"
|
|
|
|
--health-interval 10s
|
|
|
|
--health-timeout 5s
|
|
|
|
--health-retries 5
|
|
|
|
ports:
|
|
|
|
- 6379:6379
|
|
|
|
|
|
|
|
env:
|
|
|
|
DB_HOST: localhost
|
|
|
|
DB_USER: postgres
|
|
|
|
DB_PASS: postgres
|
|
|
|
DISABLE_SIMPLECOV: true
|
|
|
|
RAILS_ENV: test
|
|
|
|
ALLOW_NOPAM: true
|
|
|
|
PAM_ENABLED: true
|
|
|
|
PAM_DEFAULT_SERVICE: pam_test
|
|
|
|
PAM_CONTROLLED_SERVICE: pam_test_controlled
|
2023-07-25 03:46:57 -04:00
|
|
|
OIDC_ENABLED: true
|
|
|
|
OIDC_SCOPE: read
|
|
|
|
SAML_ENABLED: true
|
|
|
|
CAS_ENABLED: true
|
2023-05-05 03:06:51 -04:00
|
|
|
BUNDLE_WITH: 'pam_authentication test'
|
2023-03-06 22:49:43 -05:00
|
|
|
CI_JOBS: ${{ matrix.ci_job }}/4
|
2023-10-18 09:20:24 -04:00
|
|
|
GITHUB_RSPEC: ${{ matrix.ruby-version == '.ruby-version' && github.event.pull_request && 'true' }}
|
2023-03-06 22:49:43 -05:00
|
|
|
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
ruby-version:
|
|
|
|
- '3.0'
|
|
|
|
- '3.1'
|
|
|
|
- '.ruby-version'
|
|
|
|
ci_job:
|
|
|
|
- 1
|
|
|
|
- 2
|
|
|
|
- 3
|
|
|
|
- 4
|
|
|
|
steps:
|
2023-09-11 04:41:26 -04:00
|
|
|
- uses: actions/checkout@v4
|
2023-03-06 22:49:43 -05:00
|
|
|
|
|
|
|
- uses: actions/download-artifact@v3
|
|
|
|
with:
|
|
|
|
path: './public'
|
|
|
|
name: ${{ github.sha }}
|
|
|
|
|
2023-10-24 07:43:24 -04:00
|
|
|
- name: Set up Ruby environment
|
|
|
|
uses: ./.github/actions/setup-ruby
|
2023-03-06 22:49:43 -05:00
|
|
|
with:
|
|
|
|
ruby-version: ${{ matrix.ruby-version}}
|
2023-10-24 07:43:24 -04:00
|
|
|
additional-system-dependencies: ffmpeg imagemagick libpam-dev
|
2023-03-06 22:49:43 -05:00
|
|
|
|
|
|
|
- name: Load database schema
|
|
|
|
run: './bin/rails db:create db:schema:load db:seed'
|
|
|
|
|
|
|
|
- run: bundle exec rake rspec_chunked
|
2023-07-28 17:09:49 -04:00
|
|
|
|
|
|
|
test-e2e:
|
|
|
|
name: End to End testing
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
needs:
|
|
|
|
- build
|
|
|
|
|
|
|
|
services:
|
|
|
|
postgres:
|
|
|
|
image: postgres:14-alpine
|
|
|
|
env:
|
|
|
|
POSTGRES_PASSWORD: postgres
|
|
|
|
POSTGRES_USER: postgres
|
|
|
|
options: >-
|
|
|
|
--health-cmd pg_isready
|
|
|
|
--health-interval 10s
|
|
|
|
--health-timeout 5s
|
|
|
|
--health-retries 5
|
|
|
|
ports:
|
|
|
|
- 5432:5432
|
|
|
|
|
|
|
|
redis:
|
|
|
|
image: redis:7-alpine
|
|
|
|
options: >-
|
|
|
|
--health-cmd "redis-cli ping"
|
|
|
|
--health-interval 10s
|
|
|
|
--health-timeout 5s
|
|
|
|
--health-retries 5
|
|
|
|
ports:
|
|
|
|
- 6379:6379
|
|
|
|
|
|
|
|
env:
|
|
|
|
DB_HOST: localhost
|
|
|
|
DB_USER: postgres
|
|
|
|
DB_PASS: postgres
|
|
|
|
DISABLE_SIMPLECOV: true
|
|
|
|
RAILS_ENV: test
|
|
|
|
BUNDLE_WITH: test
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
ruby-version:
|
|
|
|
- '3.0'
|
|
|
|
- '3.1'
|
|
|
|
- '.ruby-version'
|
|
|
|
|
|
|
|
steps:
|
2023-09-11 04:41:26 -04:00
|
|
|
- uses: actions/checkout@v4
|
2023-07-28 17:09:49 -04:00
|
|
|
|
|
|
|
- uses: actions/download-artifact@v3
|
|
|
|
with:
|
|
|
|
path: './public'
|
|
|
|
name: ${{ github.sha }}
|
|
|
|
|
2023-10-24 07:43:24 -04:00
|
|
|
- name: Set up Ruby environment
|
|
|
|
uses: ./.github/actions/setup-ruby
|
2023-07-28 17:09:49 -04:00
|
|
|
with:
|
|
|
|
ruby-version: ${{ matrix.ruby-version}}
|
2023-10-24 07:43:24 -04:00
|
|
|
additional-system-dependencies: ffmpeg imagemagick
|
2023-07-28 17:09:49 -04:00
|
|
|
|
2023-10-24 07:43:24 -04:00
|
|
|
- name: Set up Javascript environment
|
|
|
|
uses: ./.github/actions/setup-javascript
|
2023-07-28 17:09:49 -04:00
|
|
|
|
|
|
|
- name: Load database schema
|
|
|
|
run: './bin/rails db:create db:schema:load db:seed'
|
|
|
|
|
|
|
|
- run: bundle exec rake spec:system
|
|
|
|
|
|
|
|
- name: Archive logs
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
if: failure()
|
|
|
|
with:
|
|
|
|
name: e2e-logs-${{ matrix.ruby-version }}
|
|
|
|
path: log/
|
|
|
|
|
|
|
|
- name: Archive test screenshots
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
if: failure()
|
|
|
|
with:
|
|
|
|
name: e2e-screenshots
|
|
|
|
path: tmp/screenshots/
|
2023-09-08 10:17:55 -04:00
|
|
|
|
|
|
|
test-search:
|
|
|
|
name: Testing search
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
needs:
|
|
|
|
- build
|
|
|
|
|
|
|
|
services:
|
|
|
|
postgres:
|
|
|
|
image: postgres:14-alpine
|
|
|
|
env:
|
|
|
|
POSTGRES_PASSWORD: postgres
|
|
|
|
POSTGRES_USER: postgres
|
|
|
|
options: >-
|
|
|
|
--health-cmd pg_isready
|
|
|
|
--health-interval 10s
|
|
|
|
--health-timeout 5s
|
|
|
|
--health-retries 5
|
|
|
|
ports:
|
|
|
|
- 5432:5432
|
|
|
|
|
|
|
|
redis:
|
|
|
|
image: redis:7-alpine
|
|
|
|
options: >-
|
|
|
|
--health-cmd "redis-cli ping"
|
|
|
|
--health-interval 10s
|
|
|
|
--health-timeout 5s
|
|
|
|
--health-retries 5
|
|
|
|
ports:
|
|
|
|
- 6379:6379
|
|
|
|
|
2023-10-03 04:48:32 -04:00
|
|
|
search:
|
|
|
|
image: ${{ matrix.search-image }}
|
2023-09-08 10:17:55 -04:00
|
|
|
env:
|
|
|
|
discovery.type: single-node
|
|
|
|
xpack.security.enabled: false
|
|
|
|
options: >-
|
|
|
|
--health-cmd "curl http://localhost:9200/_cluster/health"
|
|
|
|
--health-interval 10s
|
|
|
|
--health-timeout 5s
|
|
|
|
--health-retries 10
|
|
|
|
ports:
|
|
|
|
- 9200:9200
|
|
|
|
|
|
|
|
env:
|
|
|
|
DB_HOST: localhost
|
|
|
|
DB_USER: postgres
|
|
|
|
DB_PASS: postgres
|
|
|
|
DISABLE_SIMPLECOV: true
|
|
|
|
RAILS_ENV: test
|
|
|
|
BUNDLE_WITH: test
|
|
|
|
ES_ENABLED: true
|
|
|
|
ES_HOST: localhost
|
|
|
|
ES_PORT: 9200
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
ruby-version:
|
|
|
|
- '3.0'
|
|
|
|
- '3.1'
|
|
|
|
- '.ruby-version'
|
2023-10-03 04:48:32 -04:00
|
|
|
search-image:
|
|
|
|
- docker.elastic.co/elasticsearch/elasticsearch:7.17.13
|
|
|
|
include:
|
|
|
|
- ruby-version: '.ruby-version'
|
|
|
|
search-image: docker.elastic.co/elasticsearch/elasticsearch:8.10.2
|
2023-09-08 10:17:55 -04:00
|
|
|
|
|
|
|
steps:
|
2023-09-11 04:41:26 -04:00
|
|
|
- uses: actions/checkout@v4
|
2023-09-08 10:17:55 -04:00
|
|
|
|
|
|
|
- uses: actions/download-artifact@v3
|
|
|
|
with:
|
|
|
|
path: './public'
|
|
|
|
name: ${{ github.sha }}
|
|
|
|
|
2023-10-24 07:43:24 -04:00
|
|
|
- name: Set up Ruby environment
|
|
|
|
uses: ./.github/actions/setup-ruby
|
2023-09-08 10:17:55 -04:00
|
|
|
with:
|
|
|
|
ruby-version: ${{ matrix.ruby-version}}
|
2023-10-24 07:43:24 -04:00
|
|
|
additional-system-dependencies: ffmpeg imagemagick
|
2023-09-08 10:17:55 -04:00
|
|
|
|
2023-10-24 07:43:24 -04:00
|
|
|
- name: Set up Javascript environment
|
|
|
|
uses: ./.github/actions/setup-javascript
|
2023-09-08 10:17:55 -04:00
|
|
|
|
|
|
|
- name: Load database schema
|
|
|
|
run: './bin/rails db:create db:schema:load db:seed'
|
|
|
|
|
|
|
|
- run: bundle exec rake spec:search
|
|
|
|
|
|
|
|
- name: Archive logs
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
if: failure()
|
|
|
|
with:
|
|
|
|
name: test-search-logs-${{ matrix.ruby-version }}
|
|
|
|
path: log/
|
|
|
|
|
|
|
|
- name: Archive test screenshots
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
if: failure()
|
|
|
|
with:
|
|
|
|
name: test-search-screenshots
|
|
|
|
path: tmp/screenshots/
|