daily run for taf #1524
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
name: daily run for taf | |
on: | |
schedule: | |
- cron: '0 5 * * 1-5' | |
# - cron: '0 5 * * 1' | |
workflow_dispatch: | |
inputs: | |
suite: | |
description: 'Test suite to run: "full" for full run, "smoke" for smoke tests' | |
required: true | |
default: 'full' | |
target: | |
description: 'Specify a target URL to test an already existing BI server' | |
required: false | |
default: '' | |
jobs: | |
test: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
node-version: [16.x] | |
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | |
runs-on: ${{ matrix.os }} | |
env: | |
USER_ID: 1001 | |
GROUP_ID: 1001 | |
OAUTH_CLIENT_ID: APP-ZX6M8LSAN3YIIAQ5 | |
OAUTH_CLIENT_SECRET: ${{ secrets.OAUTH_CLIENT_SECRET }} | |
JWT_SECRET: ${{ secrets.JWT_SECRET }} | |
JWT_DOMAIN: localhost | |
OAUTH_AUTH_URL: https://sandbox.orcid.org/oauth/authorize | |
OAUTH_TOKEN_URL: https://sandbox.orcid.org/oauth/token | |
OAUTH_OPENID_ISSUER: https://sandbox.orcid.org | |
OAUTH_OPENID_JWKSURI: https://sandbox.orcid.org/oauth/jwks | |
OAUTH_OPENID_USERINFOURL: https://sandbox.orcid.org/oauth/userinfo | |
DB_PASSWORD: postgres | |
DB_SERVER: dbserver:5432 | |
DB_NAME: bidb | |
DB_USER: postgres | |
ADMIN_ORCID: 0000-0003-0437-8310 | |
API_INTERNAL_PORT: 8081 | |
API_INTERNAL_TEST_PORT: 8082 | |
BRAPI_SERVER_PORT: 8080 | |
BRAPI_DEFAULT_URL: http://brapiserver:8080 | |
BRAPI_REFERENCE_SOURCE: breeding-insight.net | |
BRAPI_DB_SERVER: dbserver:5432 | |
BRAPI_DB: postgres | |
BRAPI_DB_USER: postgres | |
BRAPI_DB_PASSWORD: postgres | |
WEB_BASE_URL: http://localhost | |
API_BASE_URL: http://localhost | |
REGISTERED_DOMAIN: localhost | |
EMAIL_RELAY_HOST: mailhog | |
EMAIL_RELAY_PORT: 1025 | |
EMAIL_FROM: bidevteam@cornell.edu | |
GIGWA_HOST: http://localhost:5080/ | |
GIGWA_USER: gigwadmin | |
GIGWA_PASSWORD: nimda | |
GIGWA_MONGO_USER: mongo | |
GIGWA_MONGO_PASSWORD: mongo | |
AWS_REGION: us-east-1 | |
AWS_ACCESS_KEY_ID: test | |
AWS_SECRET_KEY: test | |
AWS_S3_ENDPOINT: http://localhost:4566 | |
AWS_GENO_BUCKET: breedinginsight.org-test | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v2 | |
with: | |
node-version: ${{ matrix.node-version }} | |
#check out docker | |
- name: Docker checkout (private) | |
uses: actions/checkout@v4 | |
with: | |
repository: Breeding-Insight/bi-docker-stack | |
submodules: recursive | |
token: ${{ secrets.DOCKERPATH }} | |
path: bi-docker-stack | |
- run: npm install | |
- name: Set up debug for github actions | |
run: npm install --save-prod @actions/github @actions/core | |
- name: Set up JDK 13 | |
uses: actions/setup-java@v1.4.3 | |
with: | |
java-version: 13 | |
#from bi-docker-stack | |
- run: docker compose -f bi-docker-stack/docker-compose.yml -f bi-docker-stack/docker-compose-redis.yml -f bi-docker-stack/docker-compose-gigwa.yml -f bi-docker-stack/docker-compose-qa.yml up -d | |
- name: Set up Chrome | |
uses: browser-actions/setup-chrome@latest | |
with: | |
chrome-version: 122 | |
if: matrix.os == 'ubuntu-latest' | |
- name: Run Chrome | |
if: matrix.os == 'ubuntu-latest' | |
run: chrome --version | |
- name: Sleep to ensure docker set up | |
run: sleep 60s | |
shell: bash | |
- name: Set up required bidb data for tests | |
run: | | |
docker cp populate-taf-data.sql bidb:/populate-taf-data.sql | |
docker exec bidb psql -U postgres -a -f populate-taf-data.sql -d bidb | |
- name: Set up brapi data | |
run: | | |
trailMixId=$( docker exec bidb psql -U postgres -d bidb -t -c "SELECT id FROM program WHERE name='Trail Mix'" ) | |
snacksId=$( docker exec bidb psql -U postgres -d bidb -t -c "SELECT id FROM program WHERE name='Snacks'" ) | |
snacksId="$(echo -e "${snacksId}" | sed -e 's/^[[:space:]]*//')" | |
trailMixId="$(echo -e "${trailMixId}" | sed -e 's/^[[:space:]]*//')" | |
docker ps -a | |
docker logs brapi-server | |
docker logs biapi | |
docker logs biweb | |
docker inspect --format "{{json .State.Health }}" brapi-server | jq | |
docker exec brapi-server curl --header "Content-Type: application/json;charset=UTF-8" -v -d '[{"programName":"Snacks","externalReferences":[{"referenceSource":"breeding-insight.net","referenceID":"'"$snacksId"'"}]}]' http://localhost:8080/brapi/v2/programs | |
docker exec brapi-server curl --header "Content-Type: application/json;charset=UTF-8" -v -d '[{"programName":"Trail Mix","externalReferences":[{"referenceSource":"breeding-insight.net","referenceID":"'"$trailMixId"'"}]}]' http://localhost:8080/brapi/v2/programs | |
- name: Run tests on Chrome (full, custom URL) | |
# if: matrix.os == 'ubuntu-latest' && (contains(github.event.schedule, '0 5 * * 1') || (github.event.inputs.suite=='full')) | |
if: (github.event.inputs.suite=='full' && github.event.inputs.target != '') | |
run: npm run test:chromeWeekly --url="${github.event.inputs.target}" | |
- name: Run tests on Chrome (full) | |
# if: matrix.os == 'ubuntu-latest' && (contains(github.event.schedule, '0 5 * * 1') || (github.event.inputs.suite=='full')) | |
if: github.event.inputs.suite=='full' || contains(github.event.schedule, '0 5 * * 1-5') | |
run: npm run test:chromeWeekly | |
- name: Run tests on Chrome (smoke tests, custom URL) | |
# if: matrix.os == 'ubuntu-latest' && (contains(github.event.schedule, '0 5 * * 2-5') || (github.event.inputs.suite=='smoke')) | |
if: (github.event.inputs.suite=='smoke' && github.event.inputs.target != '') | |
run: npm run test:chromeDaily --url="${github.event.inputs.target}" | |
- name: Run tests on Chrome (smoke tests) | |
# if: matrix.os == 'ubuntu-latest' && (contains(github.event.schedule, '0 5 * * 2-5') || (github.event.inputs.suite=='smoke')) | |
if: (github.event.inputs.suite=='smoke') | |
run: npm run test:chromeDaily | |
- name: Publish Report Artifact | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: cucumber-report-${{ matrix.os }}-${{ github.run_number }} | |
path: ${{ github.workspace }}/report/* | |
- name: Test end of run container status | |
run: | | |
docker logs brapi-server | |
docker logs biapi | |
docker logs biweb | |