Create codeql.yml #302
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: Verify code | |
on: | |
push: | |
branches: [development] | |
jobs: | |
rspec: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
ruby-version: 3.0.3 | |
- name: Run specs & upload coverage report | |
uses: paambaati/[email protected] | |
env: | |
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} | |
COVERAGE: 'true' | |
with: | |
coverageCommand: bundle exec rake rspec | |
coverageLocations: ${{github.workspace}}/coverage/coverage.xml:cobertura | |
rubocop: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
ruby-version: 3.0.3 | |
- run: bin/rubocop | |
doctest: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
ruby-version: 3.0.3 | |
- run: bundle exec rake yard:doctest | |
deploy: | |
concurrency: | |
group: deploy | |
cancel-in-progress: true | |
needs: [rspec, rubocop, doctest] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
ruby-version: 3.0.3 | |
- name: Bump gem version | |
run: | | |
git config user.name github-actions | |
git config user.email [email protected] | |
bundle exec bump patch --changelog | |
- name: Build gem and release to Rubygems | |
uses: cadwallion/publish-rubygems-action@master | |
env: | |
RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Push code to main | |
run: git push origin -f development:main --follow-tags | |
- name: Get current gem version | |
run: echo "::set-output name=version::$(bundle exec bump current)" | |
id: gem | |
- name: Create github release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
release_name: Release ${{ steps.gem.outputs.version }} | |
tag_name: v${{ steps.gem.outputs.version }} | |
prerelease: false | |
draft: false | |
- name: Publish gem to Github | |
uses: jstastny/publish-gem-to-github@master | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
owner: oleander | |
docs: | |
runs-on: ubuntu-latest | |
needs: [deploy] | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
ruby-version: 3.0.3 | |
- name: Build docs | |
run: | | |
bundle exec rake yard:docs | |
git config user.name github-actions | |
git config user.email [email protected] | |
git add docs/ | |
git commit -m 'update docs' | |
git push -f origin development:gh-pages |