fix: add missing copyright headers to pass sanity check #72
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Integration Tests | |
| on: | |
| push: | |
| branches: [master] | |
| pull_request: | |
| branches: [master] | |
| schedule: | |
| # Run nightly at 2am UTC | |
| - cron: '0 2 * * *' | |
| workflow_dispatch: | |
| jobs: | |
| sandbox-test: | |
| name: Sandbox (${{ matrix.mysql-version }}) | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| mysql-version: | |
| - '8.0.42' | |
| - '8.4.4' | |
| - '9.1.0' | |
| env: | |
| GO111MODULE: on | |
| SANDBOX_BINARY: ${{ github.workspace }}/opt/mysql | |
| MYSQL_VERSION: ${{ matrix.mysql-version }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.22' | |
| - name: Install system libraries | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libaio1 libnuma1 libncurses5 | |
| - name: Build dbdeployer | |
| run: go build -o dbdeployer . | |
| - name: Cache MySQL tarball | |
| uses: actions/cache@v4 | |
| with: | |
| path: /tmp/mysql-tarball | |
| key: mysql-${{ matrix.mysql-version }}-linux-x86_64-v1 | |
| - name: Download MySQL | |
| run: | | |
| SHORT_VER=$(echo "$MYSQL_VERSION" | grep -oP '^\d+\.\d+') | |
| TARBALL="mysql-${MYSQL_VERSION}-linux-glibc2.17-x86_64.tar.xz" | |
| mkdir -p /tmp/mysql-tarball | |
| if [ ! -f "/tmp/mysql-tarball/$TARBALL" ]; then | |
| echo "Downloading $TARBALL..." | |
| curl -L -f -o "/tmp/mysql-tarball/$TARBALL" \ | |
| "https://dev.mysql.com/get/Downloads/MySQL-${SHORT_VER}/$TARBALL" \ | |
| || curl -L -f -o "/tmp/mysql-tarball/$TARBALL" \ | |
| "https://downloads.mysql.com/archives/get/p/23/file/$TARBALL" | |
| fi | |
| ls -lh "/tmp/mysql-tarball/$TARBALL" | |
| - name: Unpack MySQL | |
| run: | | |
| mkdir -p "$SANDBOX_BINARY" | |
| TARBALL="mysql-${MYSQL_VERSION}-linux-glibc2.17-x86_64.tar.xz" | |
| ./dbdeployer unpack "/tmp/mysql-tarball/$TARBALL" \ | |
| --sandbox-binary="$SANDBOX_BINARY" | |
| - name: Test single sandbox | |
| run: | | |
| ./dbdeployer deploy single "$MYSQL_VERSION" \ | |
| --sandbox-binary="$SANDBOX_BINARY" | |
| ~/sandboxes/msb_*/use -e "SELECT VERSION()" | |
| ./dbdeployer delete all --skip-confirm | |
| - name: Test replication sandbox | |
| run: | | |
| ./dbdeployer deploy replication "$MYSQL_VERSION" \ | |
| --sandbox-binary="$SANDBOX_BINARY" | |
| ~/sandboxes/rsandbox_*/check_slaves | |
| ~/sandboxes/rsandbox_*/test_replication | |
| ./dbdeployer delete all --skip-confirm | |
| - name: Cleanup | |
| if: always() | |
| run: | | |
| ./dbdeployer delete all --skip-confirm 2>/dev/null || true | |
| pkill -9 -u "$USER" mysqld 2>/dev/null || true | |
| # Test the "downloads get-by-version" + "unpack" flow that users follow | |
| # from the quickstart guide. This catches registry gaps and download issues. | |
| downloads-test: | |
| name: Downloads get-by-version (${{ matrix.short-version }}) | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| short-version: | |
| - '8.4' | |
| - '9.5' | |
| env: | |
| GO111MODULE: on | |
| SANDBOX_BINARY: ${{ github.workspace }}/opt/mysql | |
| SHORT_VERSION: ${{ matrix.short-version }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.22' | |
| - name: Install system libraries | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libaio1 libnuma1 libncurses5 | |
| - name: Build dbdeployer | |
| run: go build -o dbdeployer . | |
| - name: Test downloads get-by-version | |
| run: | | |
| echo "=== Testing: dbdeployer downloads get-by-version $SHORT_VERSION ===" | |
| ./dbdeployer downloads get-by-version "$SHORT_VERSION" --newest --minimal | |
| echo "=== Download complete ===" | |
| ls -lh mysql-*.tar.* | |
| - name: Test unpack | |
| run: | | |
| TARBALL=$(ls mysql-*.tar.* | head -1) | |
| echo "=== Unpacking: $TARBALL ===" | |
| mkdir -p "$SANDBOX_BINARY" | |
| ./dbdeployer unpack "$TARBALL" --sandbox-binary="$SANDBOX_BINARY" | |
| echo "=== Available versions ===" | |
| ./dbdeployer versions --sandbox-binary="$SANDBOX_BINARY" | |
| - name: Test deploy from downloaded binary | |
| run: | | |
| VERSION=$(./dbdeployer versions --sandbox-binary="$SANDBOX_BINARY" | grep -oP '\d+\.\d+\.\d+' | head -1) | |
| echo "=== Deploying: $VERSION ===" | |
| ./dbdeployer deploy single "$VERSION" --sandbox-binary="$SANDBOX_BINARY" | |
| ~/sandboxes/msb_*/use -e "SELECT VERSION()" | |
| ./dbdeployer delete all --skip-confirm | |
| - name: Cleanup | |
| if: always() | |
| run: | | |
| ./dbdeployer delete all --skip-confirm 2>/dev/null || true | |
| pkill -9 -u "$USER" mysqld 2>/dev/null || true |