-
Notifications
You must be signed in to change notification settings - Fork 3
131 lines (120 loc) · 3.47 KB
/
test.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
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
name: Test
on: [push, pull_request]
jobs:
variables:
runs-on: ubuntu-latest
outputs:
branch: ${{ steps.variables.outputs.branch }}
version: ${{ steps.variables.outputs.version }}
repository_url: ${{ steps.variables.outputs.repository_url }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.x.x'
- id: gitversion
uses: gittools/actions/gitversion/[email protected]
- name: Generate variables
id: variables
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: .github/scripts/variables.sh ${{ steps.gitversion.outputs.legacySemVerPadded }}
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Ruby 2.7
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
bundler-cache: true
- name: jekyll build
run: bundle exec jekyll build
- name: Upload site
uses: actions/upload-artifact@v4
with:
name: build-site
path: _site
spec:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Ruby 2.7
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
bundler-cache: true
- uses: actions/setup-java@v4
with:
distribution: adopt
java-version: 14
- uses: kamiazya/setup-graphviz@v1
- name: Cache HTMLProofer
id: cache-htmlproofer
uses: actions/cache@v4
with:
path: tmp/.htmlproofer
key: ${{ runner.os }}-htmlproofer
- name: Cache Jekyll
uses: actions/cache@v4
with:
path: |
.jekyll-cache
.jekyll-metadata
key: ${{ runner.os }}-jekyll
- name: rspec
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: bundle exec rake
- name: codecov upload
run: bundle exec rake codecov:upload || echo 'Codecov upload failed'
rubocop:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
bundler-cache: true
- uses: haya14busa/action-cond@v1
id: reporter
with:
cond: ${{ github.event_name == 'pull_request' }}
if_true: github-pr-review
if_false: github-check
- uses: reviewdog/action-rubocop@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: ${{ steps.reporter.outputs.value }}
remark-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: haya14busa/action-cond@v1
id: reporter
with:
cond: ${{ github.event_name == 'pull_request' }}
if_true: github-pr-review
if_false: github-check
- uses: reviewdog/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: ${{ steps.reporter.outputs.value }}
# deploy-dry-run:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: deploy dry-run
# run: |
# docker-compose run \
# jekyll deploy \
# --env=production \
# --dry-run
# - name: Upload deploy
# uses: actions/upload-artifact@v4
# if: always()
# with:
# name: deploy
# path: .