From 14abbfbc410dc6e7f40cb542186a8d945c14aa70 Mon Sep 17 00:00:00 2001 From: Leszek Zalewski Date: Wed, 11 Sep 2024 15:10:31 +0200 Subject: [PATCH 1/4] Update outdated GH Actions --- .github/workflows/pages.yml | 2 +- .github/workflows/release.yml | 10 +++++----- .github/workflows/tests.yml | 33 +++++++++++++++------------------ .github/workflows/tests_5.7.yml | 20 +++++++++----------- 4 files changed, 30 insertions(+), 35 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index a37e5366..7c934377 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -9,7 +9,7 @@ jobs: github-pages: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Build documentations run: .github/workflows/build-docs.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7f990459..78d9f465 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,10 +12,10 @@ jobs: runner: [ubuntu-latest, shopify-ubuntu-arm64] runs-on: ${{ matrix.runner }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Setup Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v5 with: go-version: 1.16 @@ -23,7 +23,7 @@ jobs: run: .github/workflows/build-deb.sh - name: Upload debs - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: debs-${{ github.sha }} path: build/ghostferry* @@ -32,9 +32,9 @@ jobs: runs-on: ubuntu-latest needs: build-debs steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Fetch uploaded artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: debs-${{ github.sha }} - name: shasum diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index df63c2a3..6b2897e2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,10 +14,9 @@ jobs: CI: "true" MYSQL_VERSION: "8.0" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - - name: Setup Go - uses: actions/setup-go@v2 + - uses: actions/setup-go@v5 with: go-version: 1.16 @@ -26,6 +25,7 @@ jobs: - name: Running GH-285 test run: ./examples/gh-285/bugreport.sh + go-test: runs-on: ubuntu-latest timeout-minutes: 15 @@ -33,10 +33,9 @@ jobs: CI: "true" MYSQL_VERSION: "8.0" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - - name: Setup Go - uses: actions/setup-go@v2 + - uses: actions/setup-go@v5 with: go-version: 1.16 @@ -45,6 +44,7 @@ jobs: - name: Running Golang tests run: make test-go + ruby-test: runs-on: ubuntu-latest timeout-minutes: 15 @@ -53,15 +53,12 @@ jobs: BUNDLE_WITHOUT: "development" MYSQL_VERSION: "8.0" steps: - - uses: actions/checkout@v2 - - - name: Setup Golang - uses: actions/setup-go@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: go-version: 1.16 - - name: Setup Ruby - uses: ruby/setup-ruby@v1 + - uses: ruby/setup-ruby@v1 with: ruby-version: 3.2 bundler-cache: true @@ -71,16 +68,16 @@ jobs: - name: Running Ruby tests run: bundle exec ruby test/main.rb + build-debs: strategy: matrix: runner: [ubuntu-latest, shopify-ubuntu-arm64] runs-on: ${{ matrix.runner }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - - name: Setup Go - uses: actions/setup-go@v2 + - uses: actions/setup-go@v5 with: go-version: 1.16 @@ -88,7 +85,7 @@ jobs: run: .github/workflows/build-deb.sh - name: Upload debs - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: debs-${{ github.sha }} path: build/ghostferry* @@ -98,7 +95,7 @@ jobs: needs: build-debs steps: - name: Fetch uploaded artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: debs-${{ github.sha }} - name: shasum @@ -108,7 +105,7 @@ jobs: echo "sha256sum:" cat ghostferry-$GITHUB_SHA.sha256sum - name: Upload checksum - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: debs-${{ github.sha }} path: "*.sha256sum" diff --git a/.github/workflows/tests_5.7.yml b/.github/workflows/tests_5.7.yml index ec6ae217..899e2868 100644 --- a/.github/workflows/tests_5.7.yml +++ b/.github/workflows/tests_5.7.yml @@ -14,10 +14,9 @@ jobs: CI: "true" MYSQL_VERSION: "5.7" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - - name: Setup Go - uses: actions/setup-go@v2 + - uses: actions/setup-go@v5 with: go-version: 1.16 @@ -26,6 +25,7 @@ jobs: - name: Running GH-285 test run: ./examples/gh-285/bugreport.sh + go-test: runs-on: ubuntu-latest timeout-minutes: 15 @@ -33,10 +33,9 @@ jobs: CI: "true" MYSQL_VERSION: "5.7" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - - name: Setup Go - uses: actions/setup-go@v2 + - uses: actions/setup-go@v5 with: go-version: 1.16 @@ -45,6 +44,7 @@ jobs: - name: Running Golang tests run: make test-go + ruby-test: runs-on: ubuntu-latest timeout-minutes: 15 @@ -53,15 +53,13 @@ jobs: MYSQL_VERSION: "5.7" BUNDLE_WITHOUT: "development" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - - name: Setup Golang - uses: actions/setup-go@v2 + - uses: actions/setup-go@v5 with: go-version: 1.16 - - name: Setup Ruby - uses: ruby/setup-ruby@v1 + - uses: ruby/setup-ruby@v1 with: ruby-version: 3.2 bundler-cache: true From b6b330dd8253efaf6b4002d3c2dd345b70a1aef6 Mon Sep 17 00:00:00 2001 From: Leszek Zalewski Date: Wed, 11 Sep 2024 16:13:47 +0200 Subject: [PATCH 2/4] Update upload/download-artifacts --- .github/workflows/release.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 78d9f465..496d68bf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,7 +25,7 @@ jobs: - name: Upload debs uses: actions/upload-artifact@v4 with: - name: debs-${{ github.sha }} + name: debs-${{ github.sha }}-${{ matrix.runner }} path: build/ghostferry* release: @@ -36,7 +36,8 @@ jobs: - name: Fetch uploaded artifacts uses: actions/download-artifact@v4 with: - name: debs-${{ github.sha }} + pattern: debs-${{ github.sha }}-* ++ merge-multiple: true - name: shasum shell: bash run: | From dd26480ee21aa0d7a7b94679a01d3ef75c38f320 Mon Sep 17 00:00:00 2001 From: Leszek Zalewski Date: Wed, 11 Sep 2024 16:32:23 +0200 Subject: [PATCH 3/4] Refactor the flow --- .github/workflows/tests.yml | 37 ++++++----------- .github/workflows/tests_5.7.yml | 72 --------------------------------- 2 files changed, 13 insertions(+), 96 deletions(-) delete mode 100644 .github/workflows/tests_5.7.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6b2897e2..0682e232 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -8,11 +8,14 @@ on: jobs: gh-285: + strategy: + matrix: + mysql: ["5.7", "8.0"] runs-on: ubuntu-latest timeout-minutes: 15 env: CI: "true" - MYSQL_VERSION: "8.0" + MYSQL_VERSION: ${{ matrix.mysql }} steps: - uses: actions/checkout@v4 @@ -27,11 +30,14 @@ jobs: run: ./examples/gh-285/bugreport.sh go-test: + strategy: + matrix: + mysql: ["5.7", "8.0"] runs-on: ubuntu-latest timeout-minutes: 15 env: CI: "true" - MYSQL_VERSION: "8.0" + MYSQL_VERSION: ${{ matrix.mysql }} steps: - uses: actions/checkout@v4 @@ -46,12 +52,15 @@ jobs: run: make test-go ruby-test: + strategy: + matrix: + mysql: ["5.7", "8.0"] runs-on: ubuntu-latest timeout-minutes: 15 env: CI: "true" BUNDLE_WITHOUT: "development" - MYSQL_VERSION: "8.0" + MYSQL_VERSION: ${{ matrix.mysql }} steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 @@ -87,25 +96,5 @@ jobs: - name: Upload debs uses: actions/upload-artifact@v4 with: - name: debs-${{ github.sha }} + name: debs-${{ github.sha }}-${{ matrix.runner }} path: build/ghostferry* - - checksum-debs: - runs-on: ubuntu-latest - needs: build-debs - steps: - - name: Fetch uploaded artifacts - uses: actions/download-artifact@v4 - with: - name: debs-${{ github.sha }} - - name: shasum - shell: bash - run: | - sha256sum *.deb > ghostferry-$GITHUB_SHA.sha256sum - echo "sha256sum:" - cat ghostferry-$GITHUB_SHA.sha256sum - - name: Upload checksum - uses: actions/upload-artifact@v4 - with: - name: debs-${{ github.sha }} - path: "*.sha256sum" diff --git a/.github/workflows/tests_5.7.yml b/.github/workflows/tests_5.7.yml deleted file mode 100644 index 899e2868..00000000 --- a/.github/workflows/tests_5.7.yml +++ /dev/null @@ -1,72 +0,0 @@ -name: Ghostferry MySQL 5.7 tests - -on: - push: - branches: - - main - pull_request: - -jobs: - gh-285: - runs-on: ubuntu-latest - timeout-minutes: 15 - env: - CI: "true" - MYSQL_VERSION: "5.7" - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-go@v5 - with: - go-version: 1.16 - - - name: Starting up MySQL - run: .github/workflows/start-mysql.sh - - - name: Running GH-285 test - run: ./examples/gh-285/bugreport.sh - - go-test: - runs-on: ubuntu-latest - timeout-minutes: 15 - env: - CI: "true" - MYSQL_VERSION: "5.7" - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-go@v5 - with: - go-version: 1.16 - - - name: Starting up MySQL - run: .github/workflows/start-mysql.sh - - - name: Running Golang tests - run: make test-go - - ruby-test: - runs-on: ubuntu-latest - timeout-minutes: 15 - env: - CI: "true" - MYSQL_VERSION: "5.7" - BUNDLE_WITHOUT: "development" - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-go@v5 - with: - go-version: 1.16 - - - uses: ruby/setup-ruby@v1 - with: - ruby-version: 3.2 - bundler-cache: true - - - name: Starting up MySQL - run: .github/workflows/start-mysql.sh - - - name: Running Ruby tests - run: bundle exec ruby test/main.rb - From 0a4e59ccb3d36786ba312157217c89ccd61a29b9 Mon Sep 17 00:00:00 2001 From: Leszek Zalewski Date: Wed, 11 Sep 2024 16:44:10 +0200 Subject: [PATCH 4/4] Continue on error --- .github/workflows/start-mysql.sh | 12 ++---------- .github/workflows/tests.yml | 18 +++++++++++++----- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/start-mysql.sh b/.github/workflows/start-mysql.sh index adbdd308..faf3e44b 100755 --- a/.github/workflows/start-mysql.sh +++ b/.github/workflows/start-mysql.sh @@ -1,18 +1,10 @@ #!/bin/bash set -xe -DOCKER_COMPOSE_VERSION=v2.2.3 - -sudo apt-get update -sudo apt-get install -y netcat-openbsd make gcc - -sudo curl -o /usr/local/bin/docker-compose -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` -sudo chmod +x /usr/local/bin/docker-compose - if [ "$MYSQL_VERSION" == "8.0" ]; then - docker-compose -f docker-compose_8.0.yml up -d mysql-1 mysql-2 + docker compose -f docker-compose_8.0.yml up -d mysql-1 mysql-2 else - docker-compose up -d mysql-1 mysql-2 + docker compose up -d mysql-1 mysql-2 fi MAX_ATTEMPTS=60 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0682e232..661cf91a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,4 +1,4 @@ -name: Ghostferry MySQL 8.0 tests +name: Ghostferry Tests on: push: @@ -11,14 +11,17 @@ jobs: strategy: matrix: mysql: ["5.7", "8.0"] + runs-on: ubuntu-latest + continue-on-error: true timeout-minutes: 15 + env: CI: "true" MYSQL_VERSION: ${{ matrix.mysql }} + steps: - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 with: go-version: 1.16 @@ -33,14 +36,17 @@ jobs: strategy: matrix: mysql: ["5.7", "8.0"] + runs-on: ubuntu-latest timeout-minutes: 15 + continue-on-error: true + env: CI: "true" MYSQL_VERSION: ${{ matrix.mysql }} + steps: - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 with: go-version: 1.16 @@ -55,18 +61,21 @@ jobs: strategy: matrix: mysql: ["5.7", "8.0"] + runs-on: ubuntu-latest timeout-minutes: 15 + continue-on-error: true + env: CI: "true" BUNDLE_WITHOUT: "development" MYSQL_VERSION: ${{ matrix.mysql }} + steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: go-version: 1.16 - - uses: ruby/setup-ruby@v1 with: ruby-version: 3.2 @@ -85,7 +94,6 @@ jobs: runs-on: ${{ matrix.runner }} steps: - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 with: go-version: 1.16