Skip to content

Commit

Permalink
Refactor job
Browse files Browse the repository at this point in the history
  • Loading branch information
sue445 committed Jan 2, 2020
1 parent 7a937b0 commit 5d1e358
Showing 1 changed file with 4 additions and 63 deletions.
67 changes: 4 additions & 63 deletions .github/workflows/test.yml
Expand Up @@ -120,79 +120,21 @@ jobs:
if: always()
continue-on-error: ${{ endsWith(matrix.ruby, '-dev') }}

- name: Slack Notification (not success)
uses: homoluctus/slatify@v2.0.0
if: "! success()"
with:
job_name: ${{ format('*build* ({0})', matrix.ruby) }}
type: ${{ job.status }}
icon_emoji: ":octocat:"
url: ${{ secrets.SLACK_WEBHOOK }}
token: ${{ secrets.GITHUB_TOKEN }}

lint:
runs-on: ubuntu-16.04

env:
RBENV_VERSION: 2.2.2

steps:
- uses: actions/checkout@v2

- name: Set up rbenv
uses: masa-iwasaki/setup-rbenv@1.1.0

- name: Reinstall libssl-dev
run: |
set -xe
sudo apt-get remove -y libssl-dev
sudo apt-get install -y libssl-dev=1.0.2g-1ubuntu4.15
- name: Cache RBENV_ROOT
uses: actions/cache@v1
id: cache_rbenv
with:
path: ~/.rbenv/versions
key: v1-rbenv-${{ runner.os }}-${{ env.RBENV_VERSION }}

- name: Install Ruby
run: |
set -xe
eval "$(rbenv init -)"
rbenv install -s $RBENV_VERSION
gem install bundler --no-document -v 1.17.3 || true
- name: Generate unique cache key
run: uuidgen > uuid.txt

- name: Cache vendor/bundle
uses: actions/cache@v1
id: cache_gem
with:
path: vendor/bundle
key: v1-gem-${{ runner.os }}-${{ env.RBENV_VERSION }}-${{ hashFiles('uuid.txt') }}
restore-keys: |
v1-gem-${{ runner.os }}-${{ env.RBENV_VERSION }}-
- name: bundle update
run: |
set -xe
eval "$(rbenv init -)"
bundle config path vendor/bundle
bundle update --jobs $(nproc) --retry 3
- name: Run lint
run: |
set -xe
eval "$(rbenv init -)"
bundle exec rubocop
bundle exec rubydoctest README.md
env:
RBENV_VERSION: ${{ matrix.ruby }}
continue-on-error: ${{ endsWith(matrix.ruby, '-dev') }}

- name: Slack Notification (not success)
uses: homoluctus/slatify@v2.0.0
if: "! success()"
with:
job_name: '*lint*'
job_name: ${{ format('*build* ({0})', matrix.ruby) }}
type: ${{ job.status }}
icon_emoji: ":octocat:"
url: ${{ secrets.SLACK_WEBHOOK }}
Expand All @@ -201,7 +143,6 @@ jobs:
notify:
needs:
- test
- lint

runs-on: ubuntu-latest

Expand Down

0 comments on commit 5d1e358

Please sign in to comment.