CI: update ruby versions to fix tests #3
This file contains 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: Build and Test Docker | |
on: | |
push: | |
paths-ignore: | |
- '**.md' | |
- '**.txt' | |
- 'contrib/**' | |
pull_request: | |
paths-ignore: | |
- '**.md' | |
- '**.txt' | |
- 'contrib/**' | |
env: | |
CI_IMAGE: gollum-ci-img | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install required system dependencies | |
run: | | |
sudo apt-get install -y libyaml-dev | |
- name: Check Out Repo | |
uses: actions/checkout@v2 | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Cache docker layers | |
uses: actions/cache@v2 | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ runner.os }}-buildx-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-buildx- | |
- name: Build | |
id: docker_build | |
uses: docker/build-push-action@v2 | |
with: | |
context: ./ | |
file: ./Dockerfile | |
builder: ${{ steps.buildx.outputs.name }} | |
push: false | |
tags: ${{ env.CI_IMAGE }} | |
outputs: type=docker | |
cache-from: type=local,src=/tmp/.buildx-cache | |
cache-to: type=local,dest=/tmp/.buildx-cache | |
- name: Image digest | |
run: echo ${{ steps.docker_build.outputs.digest }} | |
- name: docker state | |
run: docker image ls | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.2.1 | |
bundler-cache: true | |
- name: Install Chromedriver | |
uses: nanasess/setup-chromedriver@v2 | |
- run: | | |
export DISPLAY=:99 | |
chromedriver --url-base=/wd/hub & | |
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # optional | |
- name: Run gollum from Docker | |
run: | | |
git clone test/examples/lotr.git /tmp/lotr.git | |
RUNNER_TRACKING_ID="" docker run --user $(id -u) --rm -p 4567:4567 -v /tmp/lotr.git:/wiki -e CI=true ${{ env.CI_IMAGE }} --math katex & | |
sleep 10 | |
netstat -lt | |
- name: Run capybara tests against Dockerized instance | |
run: "GOLLUM_CAPYBARA_URL=http://127.0.0.1:4567 bundle exec rake test:capybara" |