Skip to content

Commit 31a8ff8

Browse files
committed
Setup github actions
1 parent 4a2d2e9 commit 31a8ff8

2 files changed

Lines changed: 58 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Publish gem to GitHub package registry
2+
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- name: Set up Ruby
14+
uses: gocardless/github-actions/shared/actions/ruby-bundle-install@master
15+
with:
16+
known_hosts: ${{ secrets.KNOWN_HOSTS_GITHUB_KEY }}
17+
robot_ssh_key: ${{ secrets.ROBOT_READONLY_SSH_KEY }}
18+
token: ${{ secrets.ROBOT_READONLY_PACKAGE_READER }}
19+
- name: Publish Gem
20+
uses: gocardless/github-actions/shared/actions/publish-internal-gem@master
21+
with:
22+
token: ${{ secrets.GITHUB_TOKEN }}
23+
known_hosts: ${{ secrets.KNOWN_HOSTS_GITHUB_KEY }}
24+
robot_ssh_key: ${{ secrets.ROBOT_READONLY_SSH_KEY }}

.github/workflows/tests.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: tests
2+
on: push
3+
4+
jobs:
5+
test_and_lint:
6+
runs-on: ubuntu-latest
7+
strategy:
8+
matrix:
9+
bundler_version:
10+
- 'latest'
11+
ruby_version:
12+
- '2.6'
13+
- '2.7'
14+
- '3.0'
15+
env:
16+
BUNDLE_NO-CACHE: 'true'
17+
BUNDLE_JOBS: '4'
18+
BUNDLE_RETRY: '3'
19+
steps:
20+
- uses: actions/checkout@v3.1.0
21+
- name: Set up Ruby
22+
uses: ruby/setup-ruby@v1
23+
with:
24+
bundler: ${{ matrix.bundler_version }}
25+
ruby-version: ${{ matrix.ruby-version }}
26+
bundler-cache: true
27+
- name: Run specs
28+
run: RUBYOPT="-W0" bundle exec rspec --format progress --format RSpec::Github::Formatter -o /tmp/rspec.xml
29+
- name: Rubocop
30+
run: bundle exec rubocop --extra-details --display-style-guide --parallel --force-exclusion
31+
- uses: actions/upload-artifact@v2
32+
if: failure()
33+
with:
34+
path: /tmp/ci_artifacts/

0 commit comments

Comments
 (0)