diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f0ff848a69..483fd3bb5f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -197,6 +197,15 @@ jobs: - run: npm ci + - name: configure AWS credentials for running tests + uses: aws-actions/configure-aws-credentials@v4 + id: aws-credentials + with: + role-to-assume: ${{ secrets.AWS_TEST_ROLE }} + role-session-name: github-actions + aws-region: eu-west-1 + output-credentials: true + - name: configure environment shell: bash run: | @@ -232,12 +241,17 @@ jobs: sed -i.bak -E 's/^(REPOSITORY[[:blank:]]*=[[:blank:]]*).*/\1\"'"${REPOSITORY}"'\"/' docker/.env sed -i.bak -E 's/^(MATOMO_ENABLED[[:blank:]]*=[[:blank:]]*).*/\1false/' docker/.env sed -i.bak -E 's/^(CKAN_CLOUDSTORAGE_ENABLED[[:blank:]]*=[[:blank:]]*).*/\1\"'"${CKAN_CLOUDSTORAGE_ENABLED}"'\"/' docker/.env.ckan.local + sed -i.bak -E 's/^(CKAN_CLOUDSTORAGE_DRIVER_OPTIONS[[:blank:]]*=[[:blank:]]*).*/\1\"'"{'key': '${AWS_ACCESS_KEY_ID}', 'secret': '${AWS_SECRET_ACCESS_KEY}', 'token': ''}"'\"/' docker/.env.ckan.local sed -i.bak -E 's/^(CKAN_CLOUDSTORAGE_CONTAINER_NAME[[:blank:]]*=[[:blank:]]*).*/\1\"'"${CKAN_CLOUDSTORAGE_CONTAINER_NAME}"'\"/' docker/.env.ckan.local + sed -i.bak -E 's/^(AWS_ACCESS_KEY_ID[[:blank:]]*=[[:blank:]]*).*/\1\"'"${AWS_ACCESS_KEY_ID}"'\"/' docker/.env.ckan.local + sed -i.bak -E 's/^(AWS_SECRET_ACCESS_KEY[[:blank:]]*=[[:blank:]]*).*/\1\"'"${AWS_SECRET_ACCESS_KEY}"'\"/' docker/.env.ckan.local env: REGISTRY: ${{ secrets.REGISTRY }} REPOSITORY: ${{ secrets.REPOSITORY }} CKAN_CLOUDSTORAGE_ENABLED: true CKAN_CLOUDSTORAGE_CONTAINER_NAME: ${{ secrets.CKAN_CLOUDSTORAGE_CONTAINER_NAME }} + AWS_ACCESS_KEY_ID: ${{ steps.aws-credentials.outputs.aws-access-key-id }} + AWS_SECRET_ACCESS_KEY: ${{ steps.aws-credentials.outputs.aws-secret-access-key }} - name: configure AWS credentials @@ -285,18 +299,6 @@ jobs: run: | docker load --input /tmp/nginx/nginx.tar - - name: Pull from registry - working-directory: docker - run: | - docker compose pull - - - name: configure AWS credentials for running tests - uses: aws-actions/configure-aws-credentials@v4 - with: - role-to-assume: ${{ secrets.AWS_TEST_ROLE }} - role-session-name: github-actions - aws-region: eu-west-1 - - name: bring services up working-directory: docker run: |