Skip to content

Commit

Permalink
Refactor tests to use jobs matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
driv3r committed Sep 11, 2024
1 parent b6b330d commit ba01738
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 135 deletions.
74 changes: 11 additions & 63 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,57 +7,22 @@ on:
pull_request:

jobs:
gh-285:
runs-on: ubuntu-latest
timeout-minutes: 15
env:
CI: "true"
MYSQL_VERSION: "8.0"
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
tests:
strategy:
matrix:
mysql: ["5.7", "8.0"]

go-test:
runs-on: ubuntu-latest
timeout-minutes: 15
env:
CI: "true"
MYSQL_VERSION: "8.0"
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
MYSQL_VERSION: ${{ matrix.mysql }}

ruby-test:
runs-on: ubuntu-latest
timeout-minutes: 15
env:
CI: "true"
BUNDLE_WITHOUT: "development"
MYSQL_VERSION: "8.0"
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
Expand All @@ -66,8 +31,11 @@ jobs:
- name: Starting up MySQL
run: .github/workflows/start-mysql.sh

- name: Running Ruby tests
run: bundle exec ruby test/main.rb
- name: Running Golang tests
run: make test-go

- name: Running GH-285 test
run: ./examples/gh-285/bugreport.sh

build-debs:
strategy:
Expand All @@ -76,7 +44,6 @@ jobs:
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version: 1.16
Expand All @@ -87,25 +54,6 @@ 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"
72 changes: 0 additions & 72 deletions .github/workflows/tests_5.7.yml

This file was deleted.

0 comments on commit ba01738

Please sign in to comment.