diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 5cde1f71f..6b2ea6aa6 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -152,24 +152,34 @@ jobs: - run: poetry run python manage.py collectstatic --noinput - name: Run tests run: poetry run xvfb-run --auto-servernum python manage.py test -v 3 --failfast - - docker-test: - name: Run Tests (Docker) - needs: code-ql - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Set up Docker - run: | - sudo apt-get update - sudo apt-get install docker.io +docker-test: + name: Run Tests (Docker) + needs: code-ql + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Docker + run: | + sudo apt-get update + sudo apt-get install apt-transport-https ca-certificates curl software-properties-common + + # Add Docker's official GPG key + curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg + + # Set up the Docker stable repository + echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null + + # Update apt package list and install Docker + sudo apt-get update + sudo apt-get install docker-ce docker-ce-cli containerd.io - - name: Build Docker image - run: | - docker build -t my-docker-image . + - name: Build Docker image + run: | + docker build -t my-docker-image . - - name: Run tests inside Docker - run: | - docker run --rm my-docker-image poetry run python manage.py test -v 3 --failfast \ No newline at end of file + - name: Run tests inside Docker + run: | + docker run --rm my-docker-image poetry run python manage.py test -v 3 --failfast \ No newline at end of file