Skip to content

Commit d7b50a9

Browse files
committed
Add test.yml
1 parent f3aba80 commit d7b50a9

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

.github/workflows/test.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
types:
9+
- opened
10+
- synchronize
11+
- reopened
12+
13+
jobs:
14+
test:
15+
runs-on: ubuntu-latest
16+
17+
strategy:
18+
fail-fast: false
19+
20+
matrix:
21+
ruby:
22+
- "3.3"
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
27+
- uses: ruby/setup-ruby@v1
28+
with:
29+
ruby-version: ${{ matrix.ruby }}
30+
bundler-cache: true
31+
32+
- name: bundle update
33+
run: |
34+
set -xe
35+
bundle config path vendor/bundle
36+
bundle update --jobs $(nproc) --retry 3
37+
38+
- run: sudo apt-get update
39+
- run: sudo apt-get install -y universal-ctags
40+
41+
- run: bundle exec rspec
42+
43+
- name: Slack Notification (not success)
44+
uses: act10ns/slack@v2
45+
if: "! success()"
46+
continue-on-error: true
47+
with:
48+
status: ${{ job.status }}
49+
webhook-url: ${{ secrets.SLACK_WEBHOOK }}
50+
matrix: ${{ toJson(matrix) }}
51+
52+
notify:
53+
needs:
54+
- test
55+
56+
runs-on: ubuntu-latest
57+
58+
steps:
59+
- name: Slack Notification (success)
60+
uses: act10ns/slack@v2
61+
if: always()
62+
continue-on-error: true
63+
with:
64+
status: ${{ job.status }}
65+
webhook-url: ${{ secrets.SLACK_WEBHOOK }}

0 commit comments

Comments
 (0)