Skip to content

Test Provisioning

Test Provisioning #297

Workflow file for this run

name: Test Provisioning
# Provisioning tests are expensive, so we should only run them on main branch merges
# (until later determined to be insufficent)
on:
push:
branches:
- main
paths-ignore:
- 'docs/**'
- '*.hcl'
- '*.md'
schedule:
# Fridays at midnight
- cron: '0 0 * * 5'
jobs:
macos-provision:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- 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 /usr/local/Caskroom \
/Library/Developer/CommandLineTools
- name: Run mstrap
env:
STRAP_CI: true
run: |
bin/mstrap --debug \
--config ${{ secrets.TEST_CONFIG_URL }}
- name: Install required dependencies for ruby
run: |
brew install gmp
- 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-37-test
- fedora-38-test
- ubuntu-2204-test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- 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 libevent-dev 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: |
curl -O https://more.musl.cc/x86_64-linux-musl/x86_64-linux-musl-cross.tgz
tar xzf x86_64-linux-musl-cross.tgz -C /opt
echo "/opt/x86_64-linux-musl-cross/bin" >> $GITHUB_PATH
- run: x86_64-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"