-
Notifications
You must be signed in to change notification settings - Fork 1
81 lines (65 loc) · 1.9 KB
/
main.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
name: Main
on: [push, pull_request]
env:
TOOLCHAIN_PATH: .
TOOLCHAIN_TEST: true
jobs:
test-and-publish:
if: contains(toJson(github.event.commits), '[skip ci]') == false
runs-on: ubuntu-latest
steps:
- name: "Install tools"
run: |
sudo snap install --classic ripgrep
rg --version
- name: "Setup ruby 2.7"
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.8
bundler-cache: false
- uses: actions/checkout@v1
- uses: actions/cache@v1
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: "Install Gems"
run: |
gem install bundler:2.4.21
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: "Running unit tests"
run: |
bundle exec rake toolchain:test
- name: "Linting"
run: |
bundle exec rake toolchain:lint
- name: "Generate rdoc"
run: |
bundle exec rake toolchain:rdoc
- name: "Quality check"
run: |
bundle exec rake toolchain:quality
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./coverage/lcov/docs-toolchain.lcov
- name: "Prepare upload"
if: endsWith(github.ref, '/master')
run: |
mkdir -p public
mv /tmp/rdoc /tmp/rubycritic coverage public/
cp public/rubycritic/{overview,index}.html
- name: "Deploy reports to Github Pages"
if: endsWith(github.ref, '/master')
uses: peaceiris/actions-gh-pages@v2
env:
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: ./public
PERSONAL_TOKEN: ${{ secrets.GITHUB_PAT }}
with:
keepFiles: true
- name: "Show TODOs"
run: rg -f .github/patterns.txt -t ruby .