Test Provisioning #448
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: Test Provisioning | |
| # Provisioning tests are expensive, so we should only run them on main branch | |
| # merges or manually (until later determined to be insufficent) | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths-ignore: | |
| - 'docs/**' | |
| - '*.hcl' | |
| - '*.md' | |
| schedule: | |
| # Fridays at midnight | |
| - cron: '0 0 * * 5' | |
| workflow_dispatch: | |
| jobs: | |
| macos-provision: | |
| runs-on: macos-14 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install crystal and tool dependencies | |
| run: | | |
| brew install crystal meson openssl@3 | |
| - name: Install dependencies | |
| run: shards install | |
| - name: Build mstrap | |
| run: make build STATIC=1 | |
| # Based on https://raw.githubusercontent.com/MikeMcQuaid/strap/master/.github/workflows/tests.yml | |
| - name: Run brew bot's cleanup | |
| run: brew test-bot --only-cleanup-before | |
| - name: Make macOS like new | |
| run: | | |
| sudo rm -rf /usr/local/bin/brew /usr/local/.??* \ | |
| /usr/local/Homebrew /opt/homebrew \ | |
| /usr/local/Caskroom \ | |
| /Library/Developer/CommandLineTools | |
| - name: Run mstrap | |
| env: | |
| STRAP_CI: true | |
| run: | | |
| bin/mstrap --verbose \ | |
| --config ${{ secrets.TEST_CONFIG_URL }} | |
| - name: Install required dependencies for ruby | |
| run: | | |
| brew install gmp libyaml | |
| - uses: ruby/setup-ruby@v1 | |
| with: | |
| bundler-cache: true | |
| working-directory: spec/provisioning | |
| - name: Run serverspecs | |
| env: | |
| BUNDLE_DEPLOYMENT: true | |
| run: | | |
| source ~/.mstrap/env.sh && make check-provisioning | |
| linux-x86_64-smoke-tests: | |
| strategy: | |
| matrix: | |
| test_name: | |
| - archlinux-test | |
| - fedora-38-test | |
| - fedora-39-test | |
| - ubuntu-2204-test | |
| - ubuntu-2404-test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Add Crystal repos | |
| run: curl -sSL https://crystal-lang.org/install.sh | sudo bash | |
| - name: Install crystal and tool dependencies | |
| run: | | |
| sudo apt install -y crystal libpcre2-dev libssl-dev \ | |
| curl ninja-build \ | |
| ruby ruby-bundler | |
| sudo apt purge meson | |
| sudo pip3 install meson | |
| - name: Install dependencies | |
| run: shards install | |
| - name: Install musl compiler | |
| run: | | |
| set -eu -o pipefail | |
| curl -fsSL -O https://github.com/cross-tools/musl-cross/releases/download/20250520/x86_64-unknown-linux-musl.tar.xz | |
| echo "a896bad67a4dae7cd7baece62d537fda07f8c74e65fee1b450a691b83e151a9c x86_64-unknown-linux-musl.tar.xz" | sha256sum -c - | |
| tar xaf x86_64-unknown-linux-musl.tar.xz -C /opt | |
| echo "/opt/x86_64-unknown-linux-musl/bin" >> $GITHUB_PATH | |
| sed -i 's/x86_64-linux-musl/x86_64-unknown-linux-musl/g' config/linux-x86_64-musl.ini | |
| - run: x86_64-unknown-linux-musl-gcc --version | |
| - name: Build mstrap | |
| run: | | |
| make build STATIC=1 TARGET_CABI=musl | |
| env: | |
| CC_FOR_BUILD: /usr/bin/clang | |
| CXX_FOR_BUILD: /usr/bin/clang++ | |
| LD_FOR_BUILD: lld | |
| - name: Run ${{ matrix.test_name }} smoke tests | |
| run: | | |
| make smoke-test \ | |
| TEST_NAME=${{ matrix.test_name }} \ | |
| TARGET_OS=linux \ | |
| TARGET_ARCH=x86_64 \ | |
| TARGET_CABI=musl | |
| env: | |
| MSTRAP_FLAGS: "--config ${{ secrets.TEST_CONFIG_URL }} --force" |