|
| 1 | +name: Run integration tests on HCD + Data API |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - main |
| 10 | + |
| 11 | +permissions: |
| 12 | + id-token: write # required for OIDC |
| 13 | + contents: read # required for actions/checkout if you use it |
| 14 | + |
| 15 | +env: |
| 16 | + AWS_ECR_REGION: ${{ secrets.AWS_ECR_REGION }} |
| 17 | + AWS_ECR_ACCOUNT_ID: ${{ secrets.AWS_ECR_ACCOUNT_ID }} |
| 18 | + AWS_ECR_ROLE_NAME: ${{ secrets.AWS_ECR_ROLE_NAME }} |
| 19 | + AWS_ECR_REPOSITORY: ${{ secrets.AWS_ECR_REPOSITORY }} |
| 20 | + AWS_ECR_REGISTRY: ${{ secrets.AWS_ECR_REGISTRY }} |
| 21 | + AWS_ECR_HCD_IMAGE_TAG: "1.2.3" |
| 22 | + |
| 23 | +jobs: |
| 24 | + test: |
| 25 | + env: |
| 26 | + # template: some might be needed (OpenAI API Key, "reranking API Key" ?) |
| 27 | + VAR_NAME: ${{ secrets.VAR_NAME }} |
| 28 | + runs-on: ubuntu-latest |
| 29 | + |
| 30 | + steps: |
| 31 | + - name: Checkout code |
| 32 | + uses: actions/checkout@v2 |
| 33 | + |
| 34 | + - name: Configure AWS credentials from OIDC |
| 35 | + uses: aws-actions/configure-aws-credentials@v4 |
| 36 | + with: |
| 37 | + role-to-assume: arn:aws:iam::${{ env.AWS_ECR_ACCOUNT_ID }}:role/${{ env.AWS_ECR_ROLE_NAME }} |
| 38 | + aws-region: ${{ env.AWS_ECR_REGION }} |
| 39 | + |
| 40 | + - name: Login to Amazon ECR |
| 41 | + uses: aws-actions/amazon-ecr-login@v2 |
| 42 | + |
| 43 | + - name: Pull the image |
| 44 | + run: | |
| 45 | + docker pull $AWS_ECR_REGISTRY/$AWS_ECR_REPOSITORY:$AWS_ECR_HCD_IMAGE_TAG |
| 46 | +
|
| 47 | + # TODO maybe replace this step with 'testcontainers' ? |
| 48 | + - name: Start HCD + Data API |
| 49 | + run: | |
| 50 | + docker compose up -d |
| 51 | + working-directory: docker-compose |
| 52 | + |
| 53 | + - name: A few seconds for the Data API to fully start |
| 54 | + run: sleep 10 |
| 55 | + |
| 56 | + # TODO remove this mock step |
| 57 | + - name: Issue a request to the Data API |
| 58 | + run: | |
| 59 | + curl -XPOST \ |
| 60 | + http://localhost:8181/v1/ \ |
| 61 | + -H "token: Cassandra:Y2Fzc2FuZHJh:Y2Fzc2FuZHJh" \ |
| 62 | + -H "Content-Type: application/json" \ |
| 63 | + -d '{"findKeyspaces": {}}' |
| 64 | +
|
| 65 | + # TODO set up runtime, dependencies, whatever is needed to run the c# tests |
| 66 | + |
| 67 | + # TODO run the tests |
0 commit comments