From 66736419b37439f543eea2d1b965b104020c1adc Mon Sep 17 00:00:00 2001 From: James Addison Date: Fri, 9 Aug 2024 19:08:16 +0100 Subject: [PATCH 1/4] Migration: GitHub Actions: use packaged `docker-compose-v2` from ubuntu-24.04 --- .github/workflows/deploy.yml | 8 ++++---- .github/workflows/pr.yml | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 4fa861616..725f9373c 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -19,13 +19,13 @@ jobs: COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} COVERALLS_GIT_BRANCH: ${{ github.ref }} steps: + - run: apt update + - run: apt install -y docker-compose-v2 - uses: actions/checkout@v4 - - name: Fetch latest docker-compose - run: sudo curl -L "https://github.com/docker/compose/releases/download/1.25.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose - name: Build containers - run: docker-compose -f ./docker-compose.yml -f ./docker-compose.ci.yml build --parallel + run: docker compose -f ./docker-compose.yml -f ./docker-compose.ci.yml build --parallel - name: Test - run: docker-compose -f ./docker-compose.yml -f ./docker-compose.ci.yml run -T app poetry run make test + run: docker compose -f ./docker-compose.yml -f ./docker-compose.ci.yml run -T app poetry run make test build: runs-on: ubuntu-latest needs: test diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 9c84b3af4..4589b33a8 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -13,10 +13,10 @@ jobs: test: runs-on: ubuntu-latest steps: + - run: apt update + - run: apt install -y docker-compose-v2 - uses: actions/checkout@v4 - - name: Fetch latest docker-compose - run: sudo curl -L "https://github.com/docker/compose/releases/download/1.25.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose - name: Build containers - run: docker-compose -f ./docker-compose.yml -f ./docker-compose.ci.yml build --parallel + run: docker compose -f ./docker-compose.yml -f ./docker-compose.ci.yml build --parallel - name: Test - run: docker-compose -f ./docker-compose.yml -f ./docker-compose.ci.yml run -T app poetry run make test + run: docker compose -f ./docker-compose.yml -f ./docker-compose.ci.yml run -T app poetry run make test From ebd190d08d05cccf30fe67c4b633e07b2677efbe Mon Sep 17 00:00:00 2001 From: James Addison Date: Fri, 9 Aug 2024 19:19:11 +0100 Subject: [PATCH 2/4] GitHub Actions: use `sudo` for privilege-required `apt` operations --- .github/workflows/deploy.yml | 4 ++-- .github/workflows/pr.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 725f9373c..07bd19ca9 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -19,8 +19,8 @@ jobs: COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} COVERALLS_GIT_BRANCH: ${{ github.ref }} steps: - - run: apt update - - run: apt install -y docker-compose-v2 + - run: sudo apt update + - run: sudo apt install -y docker-compose-v2 - uses: actions/checkout@v4 - name: Build containers run: docker compose -f ./docker-compose.yml -f ./docker-compose.ci.yml build --parallel diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 4589b33a8..f3ac13325 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -13,8 +13,8 @@ jobs: test: runs-on: ubuntu-latest steps: - - run: apt update - - run: apt install -y docker-compose-v2 + - run: sudo apt update + - run: sudo apt install -y docker-compose-v2 - uses: actions/checkout@v4 - name: Build containers run: docker compose -f ./docker-compose.yml -f ./docker-compose.ci.yml build --parallel From bfd343672c92e29b951955caa432d8271bcdecab Mon Sep 17 00:00:00 2001 From: James Addison Date: Fri, 9 Aug 2024 19:38:34 +0100 Subject: [PATCH 3/4] GitHub Actions: use Docker-distributed `docker-compose-plugin` instead of Ubuntu-distributed `docker-compose-v2` --- .github/workflows/deploy.yml | 2 +- .github/workflows/pr.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 07bd19ca9..63f0f6220 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -20,7 +20,7 @@ jobs: COVERALLS_GIT_BRANCH: ${{ github.ref }} steps: - run: sudo apt update - - run: sudo apt install -y docker-compose-v2 + - run: sudo apt install -y docker-compose-plugin - uses: actions/checkout@v4 - name: Build containers run: docker compose -f ./docker-compose.yml -f ./docker-compose.ci.yml build --parallel diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index f3ac13325..87ec0f3be 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - run: sudo apt update - - run: sudo apt install -y docker-compose-v2 + - run: sudo apt install -y docker-compose-plugin - uses: actions/checkout@v4 - name: Build containers run: docker compose -f ./docker-compose.yml -f ./docker-compose.ci.yml build --parallel From 57f86ed019533b5c8000f7bc702108c337866f94 Mon Sep 17 00:00:00 2001 From: James Addison Date: Fri, 9 Aug 2024 22:34:27 +0100 Subject: [PATCH 4/4] GitHub Actions: remove package-installation steps; Docker Compose v2 should be available in the runner image --- .github/workflows/deploy.yml | 2 -- .github/workflows/pr.yml | 2 -- 2 files changed, 4 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 63f0f6220..dcf1e58c8 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -19,8 +19,6 @@ jobs: COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} COVERALLS_GIT_BRANCH: ${{ github.ref }} steps: - - run: sudo apt update - - run: sudo apt install -y docker-compose-plugin - uses: actions/checkout@v4 - name: Build containers run: docker compose -f ./docker-compose.yml -f ./docker-compose.ci.yml build --parallel diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 87ec0f3be..e99eef07d 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -13,8 +13,6 @@ jobs: test: runs-on: ubuntu-latest steps: - - run: sudo apt update - - run: sudo apt install -y docker-compose-plugin - uses: actions/checkout@v4 - name: Build containers run: docker compose -f ./docker-compose.yml -f ./docker-compose.ci.yml build --parallel