diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..d5ad7d7 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,23 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.2' # You can adjust this if needed + bundler-cache: true # runs 'bundle install' and caches installed gems automatically + + - name: Run CI Script + run: script/cibuild diff --git a/script/cibuild b/script/cibuild index c3c0e99..bb0d09b 100755 --- a/script/cibuild +++ b/script/cibuild @@ -2,14 +2,6 @@ set -e -script/build +script/test -if test -e "./_site/index.html";then - echo "It builds!" - rm -Rf _site -else - echo "Huh. That's odd. The example site doesn't seem to build." - exit 1 -fi - -gem build minima.gemspec +rm -Rf _site diff --git a/script/test b/script/test new file mode 100755 index 0000000..b9cc9fa --- /dev/null +++ b/script/test @@ -0,0 +1,12 @@ +#!/bin/sh + +set -e + +script/build + +if test -e "./_site/index.html";then + echo "Integration test passed: Site built successfully!" +else + echo "Integration test failed: The example site doesn't seem to build. _site/index.html not found." + exit 1 +fi