1- name : Test
1+ name : Test Main and Feature Branch Nightly
22
33on :
44 schedule :
55 - cron : " 0 4 * * *"
6- pull_request :
76
87concurrency :
98 group : ${{ github.workflow }}-${{ github.head_ref }}
2726
2827jobs :
2928 test_main :
30- name : Test Main Branch
29+ name : Test Main Branch Nightly
3130 runs-on : ${{ matrix.os }}
32- if : ${{ github.event_name == 'schedule' }}
3331 strategy :
3432 matrix :
3533 os : [windows-2022, windows-2019, ubuntu-20.04, ubuntu-22.04]
@@ -50,25 +48,13 @@ jobs:
5048 bundle install
5149 rake
5250
53- - name : Notify Slack of Failures
54- 55- if : failure() && !github.event.pull_request.draft
56- with :
57- job-status : ${{ job.status }}
58- slack-bot-token : ${{ secrets.SLACK_BOT_TOKEN }}
59- slack-channel : ${{ secrets.SLACK_CHANNEL }}
60-
6151 test_feature :
62- name : Test Feature Branch
52+ name : Test Feature Branch Nightly
6353 runs-on : ${{ matrix.os }}
64- if : ${{ github.event_name == 'schedule' }}
6554 strategy :
6655 matrix :
6756 os : [windows-2022, windows-2019, ubuntu-20.04, ubuntu-22.04]
6857 ruby-version : [2.7, 3.0, 3.1, 3.2]
69- env :
70- RUBY_VERSION : ${{ matrix.ruby-version }}
71- OPERATING_SYSTEM : ${{ matrix.os }}
7258 steps :
7359 - name : Checkout
7460 uses : actions/checkout@v3
@@ -81,47 +67,21 @@ jobs:
8167 ruby-version : ${{ matrix.ruby-version }}
8268
8369 - name : Install Packages and Test
70+ env :
71+ RUBY_VERSION : ${{ matrix.ruby-version }}
72+ OPERATING_SYSTEM : ${{ matrix.os }}
8473 run : |
8574 bundle install
8675 rake
8776
88- - name : Notify Slack of Failures
89- 90- if : failure() && !github.event.pull_request.draft
91- with :
92- job-status : ${{ job.status }}
93- slack-bot-token : ${{ secrets.SLACK_BOT_TOKEN }}
94- slack-channel : ${{ secrets.SLACK_CHANNEL }}
95-
96- test_pr :
97- name : Test PR Branch
98- runs-on : ${{ matrix.os }}
99- if : ${{ github.event_name == 'pull_request' }}
100- strategy :
101- matrix :
102- os : [windows-2022, windows-2019, ubuntu-20.04, ubuntu-22.04]
103- ruby-version : [2.7, 3.0, 3.1, 3.2]
104- env :
105- RUBY_VERSION : ${{ matrix.ruby-version }}
106- OPERATING_SYSTEM : ${{ matrix.os }}
77+ notify_for_failures :
78+ name : Notify for Failures
79+ if : failure()
80+ runs-on : ubuntu-latest
10781 steps :
108- - name : Checkout
109- uses : actions/checkout@v3
110-
111- - name : Set up Ruby
112- uses : ruby/setup-ruby@v1
113- with :
114- ruby-version : ${{ matrix.ruby-version }}
115-
116- - name : Install Packages and Test
117- run : |
118- bundle install
119- rake
120-
12182 - name : Notify Slack of Failures
12283123- if : failure() && !github.event.pull_request.draft
12484 with :
125- job-status : ${{ job.status }}
85+ job-status : failure
12686 slack-bot-token : ${{ secrets.SLACK_BOT_TOKEN }}
12787 slack-channel : ${{ secrets.SLACK_CHANNEL }}
0 commit comments