-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: [DX-32] Add github actions for spec, release and rubocop (#11)
* [DX-32] Add github actions for spec, release and rubocop * [DX-32] Fix 18n references
- Loading branch information
1 parent
83487d5
commit a4abe39
Showing
4 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Create release pull request | ||
on: | ||
push: | ||
branches: | ||
- 'master' | ||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: GoogleCloudPlatform/release-please-action@v3 | ||
id: release | ||
with: | ||
release-type: ruby | ||
package-name: factiva-api-client | ||
bump-minor-pre-major: true | ||
version-file: 'lib/factiva/version.rb' | ||
- uses: actions/checkout@v2 | ||
if: ${{ steps.release.outputs.release_created }} | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: '3.1' | ||
if: ${{ steps.release.outputs.release_created }} | ||
- name: Publish gem to Github repostiory packages | ||
run: | | ||
mkdir -p $HOME/.gem | ||
touch $HOME/.gem/credentials | ||
chmod 0600 $HOME/.gem/credentials | ||
printf -- "---\n:github: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials | ||
gem build *.gemspec | ||
gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem | ||
env: | ||
GEM_HOST_API_KEY: "Bearer ${{secrets.GITHUB_TOKEN}}" | ||
OWNER: ${{ github.repository_owner }} | ||
if: ${{ steps.release.outputs.release_created }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Run gem static analysis | ||
on: | ||
pull_request: | ||
types: [opened, synchronize] | ||
|
||
jobs: | ||
rubocop: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- run: | | ||
git fetch --no-tags --prune origin | ||
- name: Set up Ruby 3.1 | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: '3.1' | ||
bundler-cache: true | ||
cache-version: 1 | ||
- name: rubocop | ||
uses: reviewdog/action-rubocop@v2 | ||
with: | ||
use_bundler: true | ||
reporter: github-pr-review | ||
filter_mode: file | ||
fail_on_error: true | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Run url_shortener-client gem specs | ||
on: | ||
push: | ||
branches: | ||
- "**" # matches every branch | ||
- '!master' # excludes master | ||
jobs: | ||
run-specs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 3.1 | ||
bundler-cache: true | ||
cache-version: 1 | ||
- name: Run tests | ||
run: | | ||
bundle exec rspec |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -121,6 +121,7 @@ GEM | |
|
||
PLATFORMS | ||
ruby | ||
x86_64-linux | ||
|
||
DEPENDENCIES | ||
factiva-api-client! | ||
|