From 86ca97e4c027b90ac48d4bfce86b8e3d85dd4ec0 Mon Sep 17 00:00:00 2001 From: Sebastian-Webster <84299475+Sebastian-Webster@users.noreply.github.com> Date: Thu, 24 Oct 2024 20:17:06 +1300 Subject: [PATCH 1/7] split ci workflow into many workflows --- .github/workflows/bun-compatibility.yml | 39 +++ .github/workflows/ci.yml | 418 +---------------------- .github/workflows/node-compatibility.yml | 40 +++ .github/workflows/os-compatibility.yml | 82 +++++ .github/workflows/stress.yml | 71 ++++ 5 files changed, 237 insertions(+), 413 deletions(-) create mode 100644 .github/workflows/bun-compatibility.yml create mode 100644 .github/workflows/node-compatibility.yml create mode 100644 .github/workflows/os-compatibility.yml create mode 100644 .github/workflows/stress.yml diff --git a/.github/workflows/bun-compatibility.yml b/.github/workflows/bun-compatibility.yml new file mode 100644 index 0000000..4d720f4 --- /dev/null +++ b/.github/workflows/bun-compatibility.yml @@ -0,0 +1,39 @@ +name: Bun Compatibility + +on: + push: + branches: [ main ] + pull_request: + workflow_dispatch: + +jobs: + os: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + bun-version: [1.0.0, 1.x] + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Bun ${{ matrix.bun-version }} + uses: oven-sh/setup-bun@v2 + with: + bun-version: ${{ matrix.node-version }} + + - name: Install packages + run: npm ci + + - name: Run tests + run: npm run test:ci + + - name: Upload mysqlmsn directory + if: ${{ failure() }} + uses: actions/upload-artifact@v4.3.5 + with: + name: bun-${{ matrix.bun-version }} + path: /tmp/mysqlmsn + compression-level: 9 \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2cbdfb0..18834cf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,428 +7,20 @@ on: workflow_dispatch: jobs: - ci-node-win: - runs-on: ${{ matrix.os }} - - strategy: - fail-fast: false - matrix: - os: [windows-2019, windows-2022] - # We only support Node.js 16.6.0 and newer - node-version: [16.6.0, 16.x, 17.0.0, 17.x, 18.x, 19.x, 20.x, 21.x, 22.x, 23.x] - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup node ${{ matrix.node-version }} - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} - - - name: Install packages - run: npm ci - - - name: Run tests - run: npm run test:ci --colors - - - name: Upload mysqlmsn directory - if: ${{ failure() }} - uses: actions/upload-artifact@v4.3.5 - with: - name: CI-${{ matrix.os }}-node-${{ matrix.node-version }} - path: "C:\\Users\\RUNNER~1\\mysqlmsn" - compression-level: 9 - - ci-node-unix: - runs-on: ${{ matrix.os }} - - strategy: - fail-fast: false - matrix: - os: [macos-13, macos-14, macos-15, ubuntu-20.04, ubuntu-22.04, ubuntu-24.04] - # We only support Node.js 16.6.0 and newer - node-version: [16.6.0, 16.x, 17.0.0, 17.x, 18.x, 19.x, 20.x, 21.x, 22.x, 23.x] - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup node ${{ matrix.node-version }} - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} - - - name: Install packages - run: npm ci - - - name: Run tests - run: npm run test:ci --colors - - - name: Upload mysqlmsn directory - if: ${{ failure() }} - uses: actions/upload-artifact@v4.3.5 - with: - name: CI-${{ matrix.os }}-node-${{ matrix.node-version }} - path: /tmp/mysqlmsn - compression-level: 9 - - ci-bun-win: - runs-on: ${{ matrix.os }} - - strategy: - fail-fast: false - matrix: - os: [windows-2019, windows-2022] - bun-version: [1.1.0] - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup bun ${{ matrix.bun-version }} - uses: oven-sh/setup-bun@v2 - with: - bun-version: ${{ matrix.bun-version }} - - - name: Install packages - run: bun install - - - name: Run tests - run: bun run test:ci --colors - - - name: Upload mysqlmsn directory - if: ${{ failure() }} - uses: actions/upload-artifact@v4.3.5 - with: - name: CI-${{ matrix.os }}-bun-${{ matrix.bun-version }} - path: "C:\\Users\\RUNNER~1\\mysqlmsn" - compression-level: 9 - - ci-bun-unix: - runs-on: ${{ matrix.os }} - - strategy: - fail-fast: false - matrix: - os: [macos-13, macos-14, macos-15, ubuntu-20.04, ubuntu-22.04, ubuntu-24.04] - bun-version: [1.0.0] - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup bun ${{ matrix.bun-version }} - uses: oven-sh/setup-bun@v2 - with: - bun-version: ${{ matrix.bun-version }} - - - name: Install packages - run: bun install - - - name: Run tests - run: bun run test:ci --colors - - - name: Upload mysqlmsn directory - if: ${{ failure() }} - uses: actions/upload-artifact@v4.3.5 - with: - name: CI-${{ matrix.os }}-bun-${{ matrix.bun-version }} - path: /tmp/mysqlmsn - compression-level: 9 - - test-node-win: - runs-on: ${{ matrix.os }} - needs: ci-node-win - - strategy: - fail-fast: false - matrix: - os: [windows-2019, windows-2022] - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup Node 22.x - uses: actions/setup-node@v4 - with: - node-version: 22.x - - - name: Install packages - run: npm ci - - - name: Run tests - run: npm test --colors - - test-node-unix: - runs-on: ${{ matrix.os }} - needs: ci-node-unix - - strategy: - fail-fast: false - matrix: - os: [macos-13, macos-14, macos-15, ubuntu-20.04, ubuntu-22.04, ubuntu-24.04] - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup Node 22.x - uses: actions/setup-node@v4 - with: - node-version: 22.x - - - name: Install packages - run: npm ci - - - name: Run tests - run: npm test --colors - - test-bun-win: - runs-on: ${{ matrix.os }} - needs: ci-bun-win - - strategy: - fail-fast: false - matrix: - os: [windows-2019, windows-2022] - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup bun 1.1.0 - uses: oven-sh/setup-bun@v2 - with: - bun-version: 1.1.0 - - - name: Install packages - run: bun install - - - name: Run tests - run: bun run test --colors - - test-bun-unix: - runs-on: ${{ matrix.os }} - needs: ci-bun-unix - - strategy: - fail-fast: false - matrix: - os: [macos-13, macos-14, macos-15, ubuntu-20.04, ubuntu-22.04, ubuntu-24.04] - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup bun 1.0.0 - uses: oven-sh/setup-bun@v2 - with: - bun-version: 1.0.0 - - - name: Install packages - run: bun install - - - name: Run tests - run: bun run test --colors - - stress-node-win: - runs-on: ${{ matrix.os }} - needs: test-node-win - - strategy: - fail-fast: false - matrix: - os: [windows-2019, windows-2022] - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup node 22.x - uses: actions/setup-node@v4 - with: - node-version: 22.x - - - name: Install packages - run: npm ci - - - name: Run tests - run: npm run stress --colors - - - name: Upload mysqlmsn directory - if: ${{ failure() }} - uses: actions/upload-artifact@v4.3.5 - with: - name: StressTests-${{ matrix.os }}-node - path: "C:\\Users\\RUNNER~1\\mysqlmsn" - compression-level: 9 - - stress-node-unix: - runs-on: ${{ matrix.os }} - needs: test-node-unix - - strategy: - fail-fast: false - matrix: - os: [macos-13, macos-14, macos-15, ubuntu-20.04, ubuntu-22.04, ubuntu-24.04] + ci: + runs-on: ubuntu-latest steps: - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@main - if: ${{ runner.os == 'Linux' }} - with: - tool-cache: true - android: true - dotnet: true - haskell: true - large-packages: true - docker-images: true - swap-storage: false - - - name: Free Disk Space (macOS) - if: ${{ runner.os == 'macOS' }} - working-directory: /Applications - run: | - echo 'BEFORE CLEANUP:' - df -h - sudo find . -name Xcode\*.app -delete - sudo rm -rf /Users/runner/Library/Android - echo 'AFTER CLEANUP:' - df -h - - name: Checkout uses: actions/checkout@v4 - - name: Setup node 22.x + - name: Setup node LTS uses: actions/setup-node@v4 with: - node-version: 22.x + node-version: lts/* - name: Install packages run: npm ci - name: Run tests - run: npm run stress --colors - - - name: Upload mysqlmsn directory - if: ${{ failure() }} - uses: actions/upload-artifact@v4.3.5 - with: - name: StressTests${{ matrix.os }}-node - path: | - /tmp/mysqlmsn - !/temp/mysqlmsn/dbs/*/*.sock - compression-level: 9 - - stress-bun-win: - runs-on: ${{ matrix.os }} - needs: test-bun-win - - strategy: - fail-fast: false - matrix: - os: [windows-2019, windows-2022] - bun-version: [1.1.0] - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup bun ${{ matrix.bun-version }} - uses: oven-sh/setup-bun@v2 - with: - bun-version: ${{ matrix.bun-version }} - - - name: Install packages - run: bun install - - - name: Run tests - run: bun run stress --colors - - - name: Upload mysqlmsn directory - if: ${{ failure() }} - uses: actions/upload-artifact@v4.3.5 - with: - name: StressTests-${{ matrix.os }}-bun-${{ matrix.bun-version }} - path: "C:\\Users\\RUNNER~1\\mysqlmsn" - compression-level: 9 - - stress-bun-unix: - runs-on: ${{ matrix.os }} - needs: test-bun-unix - - strategy: - fail-fast: false - matrix: - os: [macos-13, macos-14, macos-15, ubuntu-20.04, ubuntu-22.04, ubuntu-24.04] - bun-version: [1.0.0] - - steps: - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@main - if: ${{ runner.os == 'Linux' }} - with: - tool-cache: true - android: true - dotnet: true - haskell: true - large-packages: true - docker-images: true - swap-storage: false - - - name: Free Disk Space (macOS) - if: ${{ runner.os == 'macOS' }} - working-directory: /Applications - run: | - echo 'BEFORE CLEANUP:' - df -h - sudo find . -name Xcode\*.app -delete - sudo rm -rf /Users/runner/Library/Android - echo 'AFTER CLEANUP:' - df -h - - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup bun ${{ matrix.bun-version }} - uses: oven-sh/setup-bun@v2 - with: - bun-version: ${{ matrix.bun-version }} - - - name: Install packages - run: bun install - - - name: Run tests - run: bun run stress --colors - - - name: Upload test databases - if: ${{ failure() }} - uses: actions/upload-artifact@v4.3.5 - with: - name: StressTests-${{ matrix.os }}-bun - path: | - /tmp/mysqlmsn - !/temp/mysqlmsn/dbs/*/*.sock - compression-level: 9 - - fedora: - runs-on: ubuntu-latest - container: - image: fedora:40 - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install Node.js - run: sudo dnf install nodejs -y - - - name: Install required libraries - run: sudo dnf install libaio numactl -y - - - name: Install dependencies - run: npm ci - - - name: Run tests - run: npm test --colors \ No newline at end of file + run: npm run test \ No newline at end of file diff --git a/.github/workflows/node-compatibility.yml b/.github/workflows/node-compatibility.yml new file mode 100644 index 0000000..e118212 --- /dev/null +++ b/.github/workflows/node-compatibility.yml @@ -0,0 +1,40 @@ +name: Node.js Compatibility + +on: + push: + branches: [ main ] + pull_request: + workflow_dispatch: + +jobs: + os: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + node-version: [16.6.0, 16.x, 17.0.0, 17.x, 18.x, 19.x, 20.x, 21.x, 22.x, 23.x] + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup node ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + check-latest: true + + - name: Install packages + run: npm ci + + - name: Run tests + run: npm run test:ci + + - name: Upload mysqlmsn directory + if: ${{ failure() }} + uses: actions/upload-artifact@v4.3.5 + with: + name: node-${{ matrix.node-version }} + path: /tmp/mysqlmsn + compression-level: 9 \ No newline at end of file diff --git a/.github/workflows/os-compatibility.yml b/.github/workflows/os-compatibility.yml new file mode 100644 index 0000000..1a8cd31 --- /dev/null +++ b/.github/workflows/os-compatibility.yml @@ -0,0 +1,82 @@ +name: OS Compatibility + +on: + push: + branches: [ main ] + pull_request: + workflow_dispatch: + +jobs: + os: + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false + matrix: + os: [macos-13, macos-14, macos-15, ubuntu-20.04, ubuntu-22.04, ubuntu-24.04, windows-2019, windows-2022] + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup node LTS + uses: actions/setup-node@v4 + with: + node-version: lts/* + check-latest: true + + - name: Install packages + run: npm ci + + - name: Run tests + run: npm run test:ci + + - name: Upload mysqlmsn directory (Windows) + if: ${{ failure() && runner.os == 'Windows' }} + uses: actions/upload-artifact@v4.3.5 + with: + name: ${{ matrix.os }} + path: "C:\\Users\\RUNNER~1\\mysqlmsn" + compression-level: 9 + + - name: Upload mysqlmsn directory (Not Windows) + if: ${{ failure() && runner.os != 'Windows' }} + uses: actions/upload-artifact@v4.3.5 + with: + name: ${{ matrix.os }} + path: /tmp/mysqlmsn + compression-level: 9 + + fedora-docker: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + image: [fedora:40] + + container: ${{ matrix.image }} + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup node LTS + uses: actions/setup-node@v4 + with: + node-version: lts/* + check-latest: true + + - name: Install packages + run: npm ci + + - name: Run tests + run: npm run test:ci + + - name: Upload mysqlmsn directory + if: ${{ failure() }} + uses: actions/upload-artifact@v4.3.5 + with: + name: docker-${{ matrix.image }} + path: /tmp/mysqlmsn + compression-level: 9 \ No newline at end of file diff --git a/.github/workflows/stress.yml b/.github/workflows/stress.yml new file mode 100644 index 0000000..1de1824 --- /dev/null +++ b/.github/workflows/stress.yml @@ -0,0 +1,71 @@ +name: Stress Tests + +on: + push: + branches: [ main ] + pull_request: + workflow_dispatch: + +jobs: + os: + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false + matrix: + os: [macos-latest, ubuntu-latest, windows-latest] + + steps: + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@main + if: ${{ runner.os == 'Linux' }} + with: + tool-cache: true + android: true + dotnet: true + haskell: true + large-packages: true + docker-images: true + swap-storage: false + + - name: Free Disk Space (macOS) + if: ${{ runner.os == 'macOS' }} + working-directory: /Applications + run: | + echo 'BEFORE CLEANUP:' + df -h + sudo find . -name Xcode\*.app -delete + sudo rm -rf /Users/runner/Library/Android + echo 'AFTER CLEANUP:' + df -h + + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node LTS + uses: actions/setup-node@v4 + with: + node-version: lts/* + check-latest: true + + - name: Install packages + run: npm ci + + - name: Run tests + run: npm run stress + + - name: Upload mysqlmsn directory (Windows) + if: ${{ failure() && runner.os == 'Windows' }} + uses: actions/upload-artifact@v4.3.5 + with: + name: ${{ matrix.os }} + path: "C:\\Users\\RUNNER~1\\mysqlmsn" + compression-level: 9 + + - name: Upload mysqlmsn directory (Not Windows) + if: ${{ failure() && runner.os != 'Windows' }} + uses: actions/upload-artifact@v4.3.5 + with: + name: ${{ matrix.os }} + path: /tmp/mysqlmsn + compression-level: 9 \ No newline at end of file From c2d3685f7ef2b02a57207aaeb670a5a0de8f2535 Mon Sep 17 00:00:00 2001 From: Sebastian-Webster <84299475+Sebastian-Webster@users.noreply.github.com> Date: Thu, 24 Oct 2024 20:19:18 +1300 Subject: [PATCH 2/7] fixed issue with os workflow --- .github/workflows/os-compatibility.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/os-compatibility.yml b/.github/workflows/os-compatibility.yml index 1a8cd31..199017d 100644 --- a/.github/workflows/os-compatibility.yml +++ b/.github/workflows/os-compatibility.yml @@ -53,9 +53,9 @@ jobs: strategy: fail-fast: false matrix: - image: [fedora:40] + version: [40] - container: ${{ matrix.image }} + container: fedora:${{ matrix.version }} steps: - name: Checkout @@ -77,6 +77,6 @@ jobs: if: ${{ failure() }} uses: actions/upload-artifact@v4.3.5 with: - name: docker-${{ matrix.image }} + name: docker-fedora-${{ matrix.version }} path: /tmp/mysqlmsn compression-level: 9 \ No newline at end of file From 5fc26888816758a790b43b8ca736c3002ffdc03d Mon Sep 17 00:00:00 2001 From: Sebastian-Webster <84299475+Sebastian-Webster@users.noreply.github.com> Date: Thu, 24 Oct 2024 20:20:44 +1300 Subject: [PATCH 3/7] change name of job in ndoe compat --- .github/workflows/node-compatibility.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node-compatibility.yml b/.github/workflows/node-compatibility.yml index e118212..7796e1a 100644 --- a/.github/workflows/node-compatibility.yml +++ b/.github/workflows/node-compatibility.yml @@ -7,7 +7,7 @@ on: workflow_dispatch: jobs: - os: + node: runs-on: ubuntu-latest strategy: From e05fec857e9de31907235485c7f7ef957b677da5 Mon Sep 17 00:00:00 2001 From: Sebastian-Webster <84299475+Sebastian-Webster@users.noreply.github.com> Date: Thu, 24 Oct 2024 20:21:14 +1300 Subject: [PATCH 4/7] change name of job in bun compat --- .github/workflows/bun-compatibility.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bun-compatibility.yml b/.github/workflows/bun-compatibility.yml index 4d720f4..ec6f9ac 100644 --- a/.github/workflows/bun-compatibility.yml +++ b/.github/workflows/bun-compatibility.yml @@ -7,7 +7,7 @@ on: workflow_dispatch: jobs: - os: + bun: runs-on: ubuntu-latest strategy: From 19b305e1efc03e81d8f43dec7f08dfa54d9564cd Mon Sep 17 00:00:00 2001 From: Sebastian-Webster <84299475+Sebastian-Webster@users.noreply.github.com> Date: Thu, 24 Oct 2024 20:22:01 +1300 Subject: [PATCH 5/7] change name of stress ci job in stress workflow --- .github/workflows/stress.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/stress.yml b/.github/workflows/stress.yml index 1de1824..26db3c3 100644 --- a/.github/workflows/stress.yml +++ b/.github/workflows/stress.yml @@ -7,7 +7,7 @@ on: workflow_dispatch: jobs: - os: + stress: runs-on: ${{ matrix.os }} strategy: @@ -38,7 +38,7 @@ jobs: sudo rm -rf /Users/runner/Library/Android echo 'AFTER CLEANUP:' df -h - + - name: Checkout uses: actions/checkout@v4 From e4ba023d5ed30dc382ace85f337d5e2fe028c8ab Mon Sep 17 00:00:00 2001 From: Sebastian-Webster <84299475+Sebastian-Webster@users.noreply.github.com> Date: Thu, 24 Oct 2024 20:22:22 +1300 Subject: [PATCH 6/7] add colors to terminal output --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 1e87be4..6b224a9 100644 --- a/package.json +++ b/package.json @@ -16,9 +16,9 @@ "memory database" ], "scripts": { - "test": "jest --testPathIgnorePatterns=/stress-tests/ --verbose", - "test:ci": "jest --testPathIgnorePatterns=/stress-tests/ --setupFilesAfterEnv ./ciSetup.js --verbose", - "stress": "jest --runTestsByPath stress-tests/stress.test.ts --setupFilesAfterEnv ./ciSetup.js --verbose" + "test": "jest --testPathIgnorePatterns=/stress-tests/ --verbose --colors", + "test:ci": "jest --testPathIgnorePatterns=/stress-tests/ --setupFilesAfterEnv ./ciSetup.js --verbose --colors", + "stress": "jest --runTestsByPath stress-tests/stress.test.ts --setupFilesAfterEnv ./ciSetup.js --verbose --colors" }, "engines": { "node": ">=16.6.0", From 74fcfb161c93e1eab33191cd384c26a81971887c Mon Sep 17 00:00:00 2001 From: Sebastian-Webster <84299475+Sebastian-Webster@users.noreply.github.com> Date: Thu, 24 Oct 2024 21:17:49 +1300 Subject: [PATCH 7/7] install required dependencies for fedora --- .github/workflows/os-compatibility.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/os-compatibility.yml b/.github/workflows/os-compatibility.yml index 199017d..9281e19 100644 --- a/.github/workflows/os-compatibility.yml +++ b/.github/workflows/os-compatibility.yml @@ -67,6 +67,9 @@ jobs: node-version: lts/* check-latest: true + - name: Install required libraries + run: sudo dnf install libaio numactl -y + - name: Install packages run: npm ci