Skip to content

Commit

Permalink
Migrates to Github Actions (NoBrainerORM#285)
Browse files Browse the repository at this point in the history
  • Loading branch information
zedtux authored May 31, 2022
1 parent 99b96f6 commit 752f722
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 47 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
on: push

jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- ruby: 2.2
rails: 4
eventmachine: true
- ruby: 2.3
rails: 5
eventmachine: false
- ruby: 2.3
rails: 5
eventmachine: true
- ruby: 2.6
rails: 6
eventmachine: true
- ruby: 2.6
rails: 6
eventmachine: false
- ruby: 2.7
rails: 6
eventmachine: false
- ruby: 3
rails: 6
eventmachine: false
- ruby: 3
rails: 7
eventmachine: false
runs-on: ubuntu-latest
name: RSpec suite (Ruby ${{ matrix.ruby }}/Rails ${{ matrix.rails }}/EM ${{ matrix.eventmachine }})
env:
EM: ${{ matrix.eventmachine }}
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
FORCE_COLOR: 1
EARTHLY_RAILS_VERSION: ${{ matrix.rails }}
EARTHLY_RUBY_VERSION: ${{ matrix.ruby }}
steps:
- uses: actions/checkout@v3
- name: Put back the git branch into git (Earthly uses it for tagging)
run: |
branch=""
if [ -n "$GITHUB_HEAD_REF" ]; then
branch="$GITHUB_HEAD_REF"
else
branch="${GITHUB_REF##*/}"
fi
git checkout -b "$branch" || true
- name: Docker Login
run: docker login --username "$DOCKERHUB_USERNAME" --password "$DOCKERHUB_TOKEN"
- name: Download latest earthly
run: "sudo /bin/sh -c 'wget https://github.com/earthly/earthly/releases/download/v0.6.14/earthly-linux-amd64 -O /usr/local/bin/earthly && chmod +x /usr/local/bin/earthly'"
- name: Earthly version
run: earthly --version
- name: Run build
run: earthly --ci --allow-privileged +rspec --EARTHLY_RUBY_VERSION=$EARTHLY_RUBY_VERSION --EARTHLY_RAILS_VERSION=$EARTHLY_RAILS_VERSION --EM=$EM
47 changes: 0 additions & 47 deletions .travis.yml

This file was deleted.

2 changes: 2 additions & 0 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ ARG EARTHLY_RUBY_VERSION=2.7
#
# `earthly --build-arg EARTHLY_RAILS_VERSION=5 --allow-privileged +rspec`
ARG EARTHLY_RAILS_VERSION=6
# This allows one to run tests including the eventmachine gem or not
ARG EM

FROM ruby:$EARTHLY_RUBY_VERSION
WORKDIR /gem
Expand Down
1 change: 1 addition & 0 deletions docker-compose-earthly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ services:
# (see spec/spec_helper.rb), that's why we aren't setting the RDB_HOST env
# variable here.
- DB_HOST=rethinkdb
- EM=${EM}
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ version: '3'
services:
rethinkdb:
image: rethinkdb:2.4

gem:
build: .
image: nobrainerorm/nobrainer:latest
Expand Down

0 comments on commit 752f722

Please sign in to comment.