diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 0b1b256f..64651f91 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -13,7 +13,7 @@ on: required: true jobs: - build-and-push-image: + build-and-push: outputs: docker_image: ${{ steps.final.outputs.docker_image }} docker_devices: ${{ steps.final.outputs.docker_devices }} @@ -136,3 +136,28 @@ jobs: echo "docker_image=registry.internal.huggingface.tech/api-inference/community/text-generation-inference:sha-${{ env.GITHUB_SHA_SHORT}}${{ env.LABEL }}" >> "$GITHUB_OUTPUT" echo "docker_devices=${{ env.DOCKER_DEVICES }}" >> "$GITHUB_OUTPUT" echo "runs_on=${{ env.RUNS_ON }}" >> "$GITHUB_OUTPUT" + integration_tests: + concurrency: + group: ${{ github.workflow }}-${{ github.job }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + needs: build-and-push + runs-on: ${{ needs.build-and-push.outputs.runs_on }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Inject slug/short variables + uses: rlespinasse/github-slug-action@v4.4.1 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: 3.10 + - name: Install + run: | + make install-integration-tests + - name: Run tests + run: | + export DOCKER_VOLUME=/mnt/cache + export DOCKER_IMAGE=${{ needs.build-and-push.outputs.docker_image }} + export DOCKER_DEVICES=${{ needs.build-and-push.outputs.docker_devices }} + export HUGGING_FACE_HUB_TOKEN=${{ secrets.HUGGING_FACE_HUB_TOKEN }} + pytest -s -vv integration-tests diff --git a/.github/workflows/ci_build.yaml b/.github/workflows/ci_build.yaml index edbd945b..632be3d4 100644 --- a/.github/workflows/ci_build.yaml +++ b/.github/workflows/ci_build.yaml @@ -34,12 +34,3 @@ jobs: with: hardware: ${{ matrix.hardware }} secrets: inherit - integration_tests: - needs: build - uses: ./.github/workflows/integration_tests.yaml # calls the one above ^ - if: matrix.hardware == 'cuda' - with: - docker_image: ${{ needs.build.outputs.docker_image }} - docker_devices: ${{ needs.build.outputs.docker_devices }} - runs_on: ${{ needs.build.outputs.runs_on }} - secrets: inherit