Minor updates to dev_servers.py and tests/elasticsearch_fixture.py #913
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
# Build for dcicsnovault | |
name: CI | |
# Controls when the action will run. | |
on: | |
# Triggers the workflow on push or pull request events but only for the master branch | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
name: Test Suite for dcicsnovault | |
# The type of runner that the job will run on | |
runs-on: ubuntu-22.04 | |
# Build matrix | |
strategy: | |
matrix: | |
python_version: [3.9, 3.11, 3.12] | |
test_type: ['UNIT', 'INDEXING'] | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python_version }} | |
- name: Install/Link Postgres | |
run: | | |
sudo apt-get install curl ca-certificates gnupg | |
curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - | |
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' | |
sudo apt-get update | |
sudo apt-get install postgresql-11 postgresql-client-11 | |
echo "/usr/lib/postgresql/11/bin" >> $GITHUB_PATH | |
sudo ln -s /usr/lib/postgresql/11/bin/initdb /usr/local/bin/initdb | |
- name: Install Deps | |
run: | | |
make build-for-ga | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: us-east-1 | |
- name: QA (INDEXING) | |
if: ${{ matrix.test_type == 'INDEXING' }} | |
env: | |
S3_ENCRYPT_KEY: ${{ secrets.S3_ENCRYPT_KEY }} | |
# # The need for this old environment variable name will go away soon. | |
# TRAVIS_JOB_ID: sno-x-test-${{ github.run_number }}- | |
# This will be the new environment variable name. | |
TEST_JOB_ID: sno-test-indexing-${{ github.run_number }}-${{ matrix.python_version }}- | |
run: | | |
make remote-test-indexing | |
- name: QA (UNIT) | |
if: ${{ matrix.test_type == 'UNIT' }} | |
env: | |
S3_ENCRYPT_KEY: ${{ secrets.S3_ENCRYPT_KEY }} | |
# # The need for this old environment variable name will go away soon. | |
# TRAVIS_JOB_ID: sno-x-test-${{ github.run_number }}- | |
# This will be the new environment variable name. | |
TEST_JOB_ID: sno-test-unit-${{ github.run_number }}-${{ matrix.python_version }}- | |
run: | | |
make remote-test-unit | |
- name: Cleanup (INDEXING) | |
if: ${{ always() && matrix.test_type == 'INDEXING' }} | |
env: | |
S3_ENCRYPT_KEY: ${{ secrets.S3_ENCRYPT_KEY }} | |
# The need for this old environment variable name will go away soon. | |
# TRAVIS_JOB_ID: sno-x-test-${{ github.run_number }}- | |
# This will be the new environment variable name. | |
TEST_JOB_ID: sno-test-indexing-${{ github.run_number }}-${{ matrix.python_version }}- | |
run: | | |
poetry run wipe-test-indices $TEST_JOB_ID search-fourfront-testing-opensearch-kqm7pliix4wgiu4druk2indorq.us-east-1.es.amazonaws.com:443 | |
- name: Cleanup (UNIT) | |
if: ${{ always() && matrix.test_type == 'UNIT' }} | |
env: | |
S3_ENCRYPT_KEY: ${{ secrets.S3_ENCRYPT_KEY }} | |
# The need for this old environment variable name will go away soon. | |
# TRAVIS_JOB_ID: sno-x-test-${{ github.run_number }}- | |
# This will be the new environment variable name. | |
TEST_JOB_ID: sno-test-unit-${{ github.run_number }}-${{ matrix.python_version }}- | |
run: | | |
poetry run wipe-test-indices $TEST_JOB_ID search-fourfront-testing-opensearch-kqm7pliix4wgiu4druk2indorq.us-east-1.es.amazonaws.com:443 |