-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
49 lines (49 loc) · 1.66 KB
/
.gitlab-ci.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
.ruby-base:
tags:
- runner-small
image: $RUBY_IMAGE
cache:
key:
files:
- Gemfile.lock
paths:
# - ./vendor
# - ./.gem_rbs_collection
before_script:
- ruby -v
- apk update && apk --no-cache add --virtual bash git curl curl-dev ruby-dev build-base ruby ruby-io-console ruby-irb ruby-json ruby-etc ruby-bigdecimal ruby-rdoc libffi-dev zlib-dev yaml-dev
# - bundle config set path ./vendor
- bundle install --jobs=$(nproc) --retry=3
- bundle exec rbs collection install
variables:
RUBY_IMAGE: ruby:3.3-alpine
lint:
extends: .ruby-base
stage: test
script:
- bundle exec rubocop
rspec:
extends: .ruby-base
stage: test
script:
- bundle exec rbs collection update
- RUBYOPT="-rrbs/test/setup" RBS_TEST_TARGET="SBOM::CycloneDX::*" RBS_TEST_LOGLEVEL="warn" bundle exec rspec --tag '~rbs_test:skip'
- |
echo "Adjusting junit report based on project_path..."
sed -i 's|file="\./\([^"]*\)"|file="\./\1"|g' "rspec.xml" || true
cp "rspec.xml" "$CI_PROJECT_DIR/${CI_JOB_ID}_junit.xml" || true
echo "Adjusting coverage report based on project_path..."
sed -i "s|$PWD|$CI_PROJECT_DIR|g" "coverage/coverage.xml" || true
sed -i 's|filename="\([^"]*\)"|filename="\./\1"|g' "coverage/coverage.xml" || true
cp "coverage/coverage.xml" "$CI_PROJECT_DIR/${CI_JOB_ID}_cobertura.xml" || true
coverage: '/LOC\s\(\d+\.\d+%\)\scovered/'
artifacts:
when: always
paths:
- ${CI_JOB_ID}_junit.xml
- ${CI_JOB_ID}_cobertura.xml
reports:
junit: ${CI_JOB_ID}_junit.xml
coverage_report:
coverage_format: cobertura
path: ${CI_JOB_ID}_cobertura.xml