Document README files #338
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "[CI] Ruby Client" | |
on: | |
pull_request: | |
paths: | |
- ".github/workflows/ruby-client-workflow.yml" | |
- "bulletin_board/ruby-client/**" | |
push: | |
branches: | |
- develop | |
- main | |
env: | |
CI: "true" | |
SIMPLECOV: "true" | |
RUBY_VERSION: 3.1.1 | |
defaults: | |
run: | |
working-directory: ./bulletin_board/ruby-client | |
jobs: | |
lint: | |
name: Lint code | |
runs-on: ubuntu-latest | |
steps: | |
- uses: rokroskar/workflow-run-cleanup-action@v0.3.2 | |
if: "github.ref != 'refs/heads/develop'" | |
env: | |
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- uses: ruby/setup-ruby@master | |
with: | |
ruby-version: ${{ env.RUBY_VERSION }} | |
- name: Recover dependency cache | |
uses: actions/cache@v1 | |
with: | |
path: ./bulletin_board/ruby-client/vendor/bundle | |
key: ${{ runner.OS }}-ruby-client-deps-${{ hashFiles('bulletin_board/ruby-client/Gemfile.lock') }} | |
restore-keys: | | |
${{ runner.OS }}-ruby-client-deps-${{ env.cache-name }}- | |
${{ runner.OS }}-ruby-client-deps- | |
${{ runner.OS }}-ruby-client- | |
- name: Install Ruby deps | |
uses: nick-invision/retry@v1 | |
with: | |
timeout_minutes: 10 | |
max_attempts: 3 | |
command: cd bulletin_board/ruby-client && bundle install --path vendor/bundle --jobs 4 --retry 3 | |
- name: Install Rubocop | |
run: gem install rubocop | |
- run: bundle exec rubocop -P | |
name: Lint Ruby files | |
rspec-test: | |
name: RSpec tests | |
needs: lint | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: rokroskar/workflow-run-cleanup-action@v0.3.2 | |
if: "github.ref != 'refs/heads/develop'" | |
env: | |
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- uses: ruby/setup-ruby@master | |
with: | |
ruby-version: ${{ env.RUBY_VERSION }} | |
- name: Recover dependency cache | |
uses: actions/cache@v1 | |
with: | |
path: ./bulletin_board/ruby-client/vendor/bundle | |
key: ${{ runner.OS }}-ruby-client-deps-${{ hashFiles('bulletin_board/ruby-client/Gemfile.lock') }} | |
restore-keys: | | |
${{ runner.OS }}-ruby-client-deps-${{ env.cache-name }}- | |
${{ runner.OS }}-ruby-client-deps- | |
${{ runner.OS }}-ruby-client- | |
- name: Install Ruby deps | |
uses: nick-invision/retry@v1 | |
with: | |
timeout_minutes: 10 | |
max_attempts: 3 | |
command: cd bulletin_board/ruby-client && bundle install --path vendor/bundle --jobs 4 --retry 3 | |
- name: Run tests | |
run: bundle exec rspec |