From 396bff71707b9f74ea240c851909a02f67d785e3 Mon Sep 17 00:00:00 2001 From: Kyle McCormick Date: Fri, 10 Jan 2025 11:30:55 -0500 Subject: [PATCH 1/2] build: Don't fail the build if DockerHub login fails Iterating on https://github.com/openedx/edx-platform/pull/36089 Forks will fail to log into DockerHub unless the fork owner configured their own DockerHub creds. This PR is an attempt to make it so that unit tests don't fail when DockerHub login fails. --- .github/workflows/unit-tests.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 46b27d51a77..5c0d5b1eaa5 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -73,13 +73,17 @@ jobs: run: | sudo apt-get update && sudo apt-get install libmysqlclient-dev libxmlsec1-dev lynx - - name: Login to Docker Hub + # Try to log into DockerHub so that we're less likely to be rate-limited when pulling certain images. + # This will fail on any edx-platform fork which doesn't explicitly define its own DockerHub creds. + # That's OK--if we fail to log in, we'll proceed anonymously, and hope we don't get rate-limited. + - name: Try to log into Docker Hub uses: docker/login-action@v3.3.0 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_PASSWORD }} - name: Start MongoDB + if: always() # Continue even if the previous step (log into DockerHub) failed. uses: supercharge/mongodb-github-action@1.11.0 with: mongodb-version: ${{ matrix.mongo-version }} From 81db1143a704c246601d2dea6049b8937bd1f4ef Mon Sep 17 00:00:00 2001 From: Kyle McCormick Date: Fri, 10 Jan 2025 11:39:44 -0500 Subject: [PATCH 2/2] build: Replace always() with continue-on-error --- .github/workflows/unit-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 5c0d5b1eaa5..d399d38770b 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -78,12 +78,12 @@ jobs: # That's OK--if we fail to log in, we'll proceed anonymously, and hope we don't get rate-limited. - name: Try to log into Docker Hub uses: docker/login-action@v3.3.0 + continue-on-error: true with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_PASSWORD }} - name: Start MongoDB - if: always() # Continue even if the previous step (log into DockerHub) failed. uses: supercharge/mongodb-github-action@1.11.0 with: mongodb-version: ${{ matrix.mongo-version }}