-
-
Notifications
You must be signed in to change notification settings - Fork 35
49 lines (49 loc) · 1.65 KB
/
Copy pathruby.yml
File metadata and controls
49 lines (49 loc) · 1.65 KB
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
name: Ruby
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
ruby: ['4.0', '3.4']
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0 # fetch all since test fixtures depend on history
- name: Set up Ruby ${{ matrix.ruby }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Build and test with Rake
run: |
gem install bundler undercover --no-doc
bundle install --jobs 4 --retry 3
rake
- name: undercover (local)
run: |
git fetch --update-head-ok origin master:master
undercover --simplecov coverage/undercover_coverage.json --compare master
- uses: actions/upload-artifact@v7
with:
name: undercover-${{ matrix.ruby }}-coverage
path: coverage/undercover_coverage.json
coverage:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/download-artifact@v8
with:
name: undercover-4.0-coverage
- name: Upload coverage
run: |
output=$(ruby -e "$(curl -s https://undercover-ci.com/uploader.rb)" -- \
--repo grodowski/undercover \
--commit ${{ github.event.pull_request.head.sha || github.sha }} \
--simplecov /home/runner/work/undercover/undercover/undercover_coverage.json 2>&1) || {
if echo "$output" | grep -q "has already completed"; then
echo "Coverage already processed for this commit ✅"
else
echo "Coverage upload failed: $output"
exit 1
fi
}