Commit 6b76bf2

mo khan <mo.khan@gmail.com>
2021-02-05 02:21:36
chore: enable github actions
1 parent 9d46474
.github/workflows/ci.yml
@@ -0,0 +1,41 @@
+name: ci
+on:
+  push:
+    branches: [main]
+  pull_request:
+    branches: [main]
+jobs:
+  test:
+    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        ruby-version: ['2.5', '2.6', '2.7', '3.0']
+    steps:
+      - uses: actions/checkout@v2
+      - name: Set up Ruby
+        uses: ruby/setup-ruby@v1
+        with:
+          ruby-version: ${{ matrix.ruby-version }}
+          bundler-cache: true
+      - name: Running tests…
+        run: sh bin/test
+  style:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v2
+      - uses: ruby/setup-ruby@v1
+        with:
+          ruby-version: '3.0'
+          bundler-cache: true
+      - name: Running style checks…
+        run: sh bin/style
+  audit:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v2
+      - uses: ruby/setup-ruby@v1
+        with:
+          ruby-version: '3.0'
+          bundler-cache: true
+      - name: Running audit…
+        run: sh bin/audit
bin/audit
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+set -e
+[ -z "$DEBUG" ] || set -x
+
+cd "$(dirname "$0")/.."
+
+bundle exec rake bundle:audit
bin/cibuild
@@ -1,21 +0,0 @@
-#!/bin/sh
-
-# script/cibuild: Setup environment for CI to run tests. This is primarily
-#                 designed to run on the continuous integration server.
-
-set -e
-
-cd "$(dirname "$0")/.."
-
-echo [$(date "+%H:%M:%S")] "==> Started at…"
-
-# GC customizations
-export RUBY_GC_MALLOC_LIMIT=79000000
-export RUBY_GC_HEAP_INIT_SLOTS=800000
-export RUBY_HEAP_FREE_MIN=100000
-export RUBY_HEAP_SLOTS_INCREMENT=400000
-export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1
-
-ruby -v
-gem install bundler --conservative -v '~> 2.0'
-bin/test
bin/lint
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-set -e
-
-[ -z "$DEBUG" ] || set -x
-
-echo [$(date "+%H:%M:%S")] "==> Running setup…"
-bin/setup
-
-echo [$(date "+%H:%M:%S")] "==> Running linters…"
-bundle exec rake lint
bin/setup
@@ -1,6 +1,8 @@
-#!/usr/bin/env bash
-set -euo pipefail
-IFS=$'\n\t'
-set -vx
+#!/bin/sh
+
+set -e
+[ -z "$DEBUG" ] || set -x
+
+cd "$(dirname "$0")/.."
 
 bundle install
bin/style
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+set -e
+[ -z "$DEBUG" ] || set -x
+
+cd "$(dirname "$0")/.."
+
+bundle exec rake rubocop
bin/test
@@ -1,17 +1,8 @@
 #!/bin/sh
 
-# script/test: Run test suite for application. Optionally pass in a path to an
-#              individual test file to run a single test.
-
-
 set -e
-
-cd "$(dirname "$0")/.."
-
 [ -z "$DEBUG" ] || set -x
 
-echo [$(date "+%H:%M:%S")] "==> Running setup…"
-bin/setup
+cd "$(dirname "$0")/.."
 
-echo [$(date "+%H:%M:%S")] "==> Running tests…"
 bundle exec rake spec
Rakefile
@@ -10,4 +10,3 @@ RuboCop::RakeTask.new(:rubocop)
 Bundler::Audit::Task.new
 
 task default: :spec
-task lint: [:rubocop, 'bundle:audit']