-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (78 loc) · 2.7 KB
/
Copy pathci.yml
File metadata and controls
98 lines (78 loc) · 2.7 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
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
97
98
name: CI
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
jobs:
test:
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.ruby-version == 'debug' }}
strategy:
matrix:
ruby-version: ['3.3', '3.4', '4.0', debug]
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Set up Ruby ${{ matrix.ruby-version }}
uses: ruby/setup-ruby@afeafc3d1ab54a631816aba4c914a0081c12ff2f # v1.310.0
with:
ruby-version: ${{ matrix.ruby-version }}
# The debug (nightly) Ruby ships an old default Bundler that crashes on
# `bundle install` (NameError: uninitialized constant Pathname::SEPARATOR_PAT).
# Use the latest Bundler there so the nightly tests can actually run.
bundler: ${{ matrix.ruby-version == 'debug' && 'latest' || 'default' }}
bundler-cache: false
- name: Fix gem directory permissions (Ruby 4.0+)
if: matrix.ruby-version == '4.0'
run: chmod -R o-w "$(ruby -e 'puts Gem.dir')"
- name: Add platform and install dependencies
run: |
bundle lock --add-platform x86_64-linux
bundle install
- name: Run tests
run: bundle exec rake test
env:
CI: true
- name: Upload coverage to Codecov
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
if: matrix.ruby-version == '3.4'
with:
files: ./coverage/lcov/taski.lcov
fail_ci_if_error: false
verbose: true
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Set up Ruby
uses: ruby/setup-ruby@afeafc3d1ab54a631816aba4c914a0081c12ff2f # v1.310.0
with:
ruby-version: 3.4
bundler-cache: false
- name: Add platform and install dependencies
run: |
bundle lock --add-platform x86_64-linux
bundle install
- name: Run Standard
run: bundle exec standardrb
build:
runs-on: ubuntu-latest
needs: [test, lint]
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Set up Ruby
uses: ruby/setup-ruby@afeafc3d1ab54a631816aba4c914a0081c12ff2f # v1.310.0
with:
ruby-version: 3.4
bundler-cache: false
- name: Add platform and install dependencies
run: |
bundle lock --add-platform x86_64-linux
bundle install
- name: Build gem
run: gem build taski.gemspec
- name: Upload gem artifact
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: taski-gem
path: taski-*.gem