-
Notifications
You must be signed in to change notification settings - Fork 1
96 lines (92 loc) · 2.64 KB
/
specs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Spec & Lint
on:
push:
paths:
- .github/workflows/specs.yml
- lib/**
- spec/**
- Gemfile
- "*.gemspec"
- ".rubocop.yml"
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "2.4"
- name: Install bundler
run: gem install bundler
- name: Run rubocop
run: bin/rubocop -ESD
spec:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby: ["2.4", "2.5", "2.6", "2.7", "3.0", "3.1", "jruby", "truffleruby"]
include:
- ruby: "3.0"
coverage: "true"
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{matrix.ruby}}
bundler-cache: true
- name: Download test reporter
if: "matrix.coverage == 'true'"
run: |
mkdir -p tmp/
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-0.9.0-linux-amd64 > ./tmp/cc-test-reporter
chmod +x ./tmp/cc-test-reporter
./tmp/cc-test-reporter before-build
- name: Bundle install
env:
COVERAGE: ${{matrix.coverage}}
run: |
gem install bundler
bundle install --jobs 4 --retry 3 --without tools docs benchmarks
- name: Run all tests
env:
COVERAGE: ${{matrix.coverage}}
run: bundle exec rake
- name: Send coverage results
if: "matrix.coverage == 'true'"
env:
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
GIT_COMMIT_SHA: ${{github.sha}}
GITHUB_REF: ${{github.ref}}
GIT_COMMITTED_AT: ${{github.event.head_commit.timestamp}}
run: |
export GIT_BRANCH=`ruby -e "puts ENV['GITHUB_REF'].split('/', 3).last"`
export GIT_COMMITTED_AT=`ruby -r time -e "puts Time.iso8601(ENV['GIT_COMMITTED_AT']).to_i"`
echo "branch: $GIT_BRANCH"
echo "date: $GIT_COMMITTED_AT"
./tmp/cc-test-reporter after-build -t simplecov
mutant:
name: Mutant
runs-on: ubuntu-latest
continue-on-error: true
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
ruby: ["2.6", "2.7", "3.0", "3.1"]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{matrix.ruby}}
bundler-cache: true
- name: Bundle install
run: |
gem install bundler
bundle install --jobs 4 --retry 3 --without tools docs benchmarks
- run: bundle exec mutant run --since HEAD~1 --zombie