-
Notifications
You must be signed in to change notification settings - Fork 37
134 lines (127 loc) · 4.09 KB
/
Copy pathtest.yml
File metadata and controls
134 lines (127 loc) · 4.09 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: test
# doc/ 等ドキュメントだけの変更では CI を回さない(doctree と同様)
on:
push:
paths-ignore:
- 'doc/**'
- 'README.md'
- 'ChangeLog'
pull_request:
paths-ignore:
- 'doc/**'
- 'README.md'
- 'ChangeLog'
jobs:
ruby-versions:
runs-on: ubuntu-latest
outputs:
versions: ${{ steps.versions.outputs.value }}
steps:
- id: versions
run: |
versions=$(curl -s 'https://cache.ruby-lang.org/pub/misc/ci_versions/cruby.json' | jq -c '. + []')
echo "value=${versions}" >> $GITHUB_OUTPUT
build:
needs: ruby-versions
runs-on: ubuntu-latest
strategy:
matrix:
ruby: ${{ fromJson(needs.ruby-versions.outputs.versions) }}
env:
# Released Bundler is broken on ruby-head due to ruby/ruby#16895.
# Use Ruby's bundled Bundler until rubygems/rubygems#9529 is released.
BUNDLER_VERSION: ${{ matrix.ruby == 'head' && '0' || '' }}
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Install dependencies
run: bundle install
- name: Run test
run: bundle exec rake
typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
# 型検査は1バージョンで回せば十分(バージョン網羅は build ジョブが担う)。
# rbs 3.10 / steep 1.9(Gemfile.lock で固定)の検証済み環境である 3.4 を使う
ruby-version: '3.4'
bundler-cache: true
- name: Install RBS collection
# --frozen: rbs_collection.lock.yaml のとおりに取得する。
# 再解決すると gem_rbs_collection の revision が動き、環境差も出るため
run: bundle exec rbs collection install --frozen
# sig/ が lib/ の全宣言をカバーしているか(rbs subtract の残余ゼロ)+ rbs validate
- name: Check sig coverage
run: bundle exec rake sig
- name: Run steep check
run: bundle exec steep check
rurema:
needs: ruby-versions
runs-on: ubuntu-latest
strategy:
matrix:
# NOTE: rurema/doctreeは2.5+しかサポートしていない
ruby: ${{ fromJson(needs.ruby-versions.outputs.versions) }}
env:
# Released Bundler is broken on ruby-head due to ruby/ruby#16895.
# Use Ruby's bundled Bundler until rubygems/rubygems#9529 is released.
BUNDLER_VERSION: ${{ matrix.ruby == 'head' && '0' || '' }}
steps:
- uses: actions/checkout@v4
with:
path: 'bitclust'
- uses: actions/checkout@v4
with:
repository: 'rurema/doctree'
path: 'doctree'
ref: 'master'
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Install dependencies
run: bundle install
working-directory: ./doctree
- name: Run rake
run: bundle exec rake
working-directory: ./doctree
- name: Create tarballs
run: |
set -ex
mkdir /tmp/artifact
cd /tmp/html
for d in *.*; do
tar acf ../artifact/$d.tar.xz $d
done
- uses: actions/upload-artifact@v4
with:
name: statichtml-ubuntu-latest-${{ matrix.ruby }}
path: /tmp/artifact/*.tar.xz
- name: Rename generated html
run: |
cd /tmp
mv -v html html.pr
- uses: actions/checkout@v4
with:
path: 'bitclust'
ref: ${{ github.event.pull_request.base.sha }}
- name: Install dependencies
run: bundle install
working-directory: ./doctree
- name: Run rake
run: bundle exec rake
working-directory: ./doctree
- name: Rename generated html and generate diff
run: |
cd /tmp
mv -v html html.base
git diff --no-index html.base html.pr --stat || true
git diff --no-index html.base html.pr --output artifact/html.diff || true
- uses: actions/upload-artifact@v4
with:
name: diff-ubuntu-latest-${{ matrix.ruby }}
path: /tmp/artifact/html.diff