Skip to content

Commit 3534082

Browse files
authored
Merge pull request #168 from ybiquitous/refactor-github-actions
Refactor GitHub Actions config
2 parents 3a43234 + db5718e commit 3534082

File tree

1 file changed

+22
-40
lines changed

1 file changed

+22
-40
lines changed

.github/workflows/main.yml

Lines changed: 22 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -8,60 +8,42 @@ on:
88

99
jobs:
1010
test:
11-
runs-on: ubuntu-18.04
11+
runs-on: ${{ matrix.os }}
12+
timeout-minutes: 30
1213
strategy:
1314
fail-fast: false
1415
matrix:
15-
os: [ubuntu, macos]
16-
ruby: [2.5, 2.6, 2.7, '3.0', 3.1, head, debug, truffleruby, truffleruby-head]
16+
os: [ubuntu-latest, macos-latest]
17+
ruby: [2.5, 2.6, 2.7, '3.0', 3.1, head, debug, truffleruby, truffleruby-head, jruby, jruby-head]
1718
steps:
18-
- uses: actions/checkout@v2
19+
- uses: actions/checkout@v3
1920
- name: Set up Ruby
2021
uses: ruby/setup-ruby@v1
2122
with:
2223
ruby-version: ${{ matrix.ruby }}
2324
bundler-cache: true
24-
- name: Install dependencies
25-
run: bundle install
25+
- name: Set JRUBY_OPTS environment variable
26+
run: echo "JRUBY_OPTS=--debug" >> "$GITHUB_ENV"
27+
if: ${{ startsWith(matrix.ruby, 'jruby') }}
2628
- name: Run tests
2729
run: bundle exec rake
28-
test-jruby:
29-
runs-on: ubuntu-18.04
30-
strategy:
31-
fail-fast: false
32-
matrix:
33-
os: [ubuntu, macos]
34-
jruby: [jruby, jruby-head]
35-
steps:
36-
- uses: actions/checkout@v2
37-
- name: Set up Ruby
38-
uses: ruby/setup-ruby@v1
30+
- uses: actions/upload-artifact@v3
31+
if: ${{ matrix.os == 'ubuntu-latest' && matrix.ruby == '3.0' }}
3932
with:
40-
ruby-version: ${{ matrix.jruby }}
41-
bundler-cache: true
42-
- name: Install dependencies
43-
env:
44-
JRUBY_OPTS: --debug
45-
run: bundle install
46-
- name: Run tests
47-
env:
48-
JRUBY_OPTS: --debug
49-
run: bundle exec rake
33+
name: coverage
34+
path: './coverage/lcov/omniauth-oauth2.lcov'
35+
retention-days: 1
36+
5037
coveralls:
51-
runs-on: ubuntu-18.04
38+
needs: test
39+
runs-on: ubuntu-latest
40+
timeout-minutes: 30
5241
steps:
53-
- uses: actions/checkout@v2
54-
- name: Set up Ruby
55-
uses: ruby/setup-ruby@v1
42+
- uses: actions/download-artifact@v3
5643
with:
57-
ruby-version: 2.6
58-
bundler-cache: true
59-
- name: Install dependencies
60-
run: bundle install
61-
- name: Run tests
62-
run: bundle exec rake
44+
name: coverage
45+
path: './coverage/lcov/'
6346
- name: Coveralls GitHub Action
64-
uses: coverallsapp/github-action@v1.1.2
47+
uses: coverallsapp/github-action@v2
6548
with:
66-
github-token: ${{ secrets.github_token }}
67-
path-to-lcov: './coverage/lcov/omniauth-oauth2.lcov'
49+
file: './coverage/lcov/omniauth-oauth2.lcov'

0 commit comments

Comments
 (0)