parent
a663bae03b
commit
49086b6058
37
.github/workflows/dynamic.yml
vendored
Normal file
37
.github/workflows/dynamic.yml
vendored
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
name: Runtime tests
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ master ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
syntax:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Set up Ruby 3.1
|
||||||
|
uses: actions/setup-ruby@v1
|
||||||
|
with:
|
||||||
|
ruby-version: 3.1.x
|
||||||
|
- name: Loading all files should not crash
|
||||||
|
run: |
|
||||||
|
gem install bundler
|
||||||
|
bundle install --jobs 4 --retry 3
|
||||||
|
./scripts/require_all.sh
|
||||||
|
unit-tests:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Set up Ruby 3.1
|
||||||
|
uses: actions/setup-ruby@v1
|
||||||
|
with:
|
||||||
|
ruby-version: 3.1.x
|
||||||
|
- name: Run rspec tests
|
||||||
|
run: |
|
||||||
|
gem install bundler
|
||||||
|
bundle install --jobs 4 --retry 3
|
||||||
|
bundle exec rspec
|
23
.github/workflows/ruby_rspec.yml
vendored
23
.github/workflows/ruby_rspec.yml
vendored
|
@ -1,23 +0,0 @@
|
||||||
name: Unit tests
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ master ]
|
|
||||||
pull_request:
|
|
||||||
branches: [ master ]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
rspec:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- name: Set up Ruby 3.1
|
|
||||||
uses: actions/setup-ruby@v1
|
|
||||||
with:
|
|
||||||
ruby-version: 3.1.x
|
|
||||||
- name: Run rspec tests
|
|
||||||
run: |
|
|
||||||
gem install bundler
|
|
||||||
bundle install --jobs 4 --retry 3
|
|
||||||
bundle exec rspec
|
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,4 +1,5 @@
|
||||||
Gemfile.lock
|
Gemfile.lock
|
||||||
|
scripts/tmp
|
||||||
integration_test/*.txt
|
integration_test/*.txt
|
||||||
integration_test/*.log
|
integration_test/*.log
|
||||||
integration_test/*.db
|
integration_test/*.db
|
||||||
|
|
39
scripts/require_all.sh
Executable file
39
scripts/require_all.sh
Executable file
|
@ -0,0 +1,39 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [ ! -d spec ]
|
||||||
|
then
|
||||||
|
echo "Error: spec folder not found"
|
||||||
|
echo " run this script from the root of repo"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
tmpdir=scripts/tmp
|
||||||
|
mkdir -p scripts/tmp
|
||||||
|
tmpfile="$tmpdir/require_all.rb"
|
||||||
|
{
|
||||||
|
echo '# frozen_string_literal: true'
|
||||||
|
echo ''
|
||||||
|
} > "$tmpfile"
|
||||||
|
|
||||||
|
function require_all() {
|
||||||
|
local ruby_file
|
||||||
|
while read -r ruby_file
|
||||||
|
do
|
||||||
|
ruby_file="${ruby_file::-3}"
|
||||||
|
echo "require_relative '../../$ruby_file'" >> "$tmpfile"
|
||||||
|
done < <(find lib/ -name "*.rb")
|
||||||
|
if ruby "$tmpfile"
|
||||||
|
then
|
||||||
|
echo "[+] OK: no file crashed when being run."
|
||||||
|
return 1
|
||||||
|
else
|
||||||
|
echo "[-] Error: loading all files crashed"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
if require_all
|
||||||
|
then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
Loading…
Reference in a new issue