Skip to content

OC-974: Enable easier searching of publications on author pages #1191

OC-974: Enable easier searching of publications on author pages

OC-974: Enable easier searching of publications on author pages #1191

Workflow file for this run

name: API-Tests
on:
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
jobs:
api-tests:
timeout-minutes: 15
runs-on: ubuntu-latest
if: ${{ !github.event.pull_request.draft }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure aws credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
role-session-name: github-actions-api-tests
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
# Note: this step is only required locally when using act since the ubuntu image
# does not come with docker-compose installed, however the alternative to the reinstall
# here is you'd have to install a custom docker image locally which includes docker-compose
# uncomment below locally and change 'docker compose' to 'docker-compose' in the 'run:' line:
# - name: Install docker-compose
# run: |
# sudo curl -L https://github.com/docker/compose/releases/download/1.29.2/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
# sudo chmod +x /usr/local/bin/docker-compose
- name: Run docker-compose
working-directory: ./api
env:
DATACITE_USER: ${{ secrets.DATACITE_USER }}
DATACITE_PASSWORD: ${{ secrets.DATACITE_PASSWORD }}
ORCID_ID: ${{ secrets.ORCID_ID }}
ORCID_SECRET: ${{ secrets.ORCID_SECRET }}
run: |
export SERVERLESS_LICENSE_KEY=`aws ssm get-parameter --name ${{ secrets.SERVERLESS_LICENSE_KEY_SSM_PARAMETER_ARN }} --query "Parameter.Value" --output text`
docker compose up -d --build
- name: Wait for API and DB to be ready
run: docker exec -t api-test dockerize -wait tcp://db:5432 -wait tcp://api-test:4003 -wait tcp://mailpit:8025 -wait tcp://localstack:4566 -timeout 120s
- name: docker logs
if: failure()
run: docker logs api-test
- name: Run test suite
working-directory: ./api
run: docker exec -t api-test npm run test:local
- name: Stop containers
working-directory: ./api
run: docker compose down