From dc868a004a3810b29456c4df089ac9eab2b6c752 Mon Sep 17 00:00:00 2001 From: Matthew Brown Date: Tue, 4 Jul 2023 13:17:50 +0100 Subject: [PATCH] Setup github actions --- .github/workflows/release.yml | 24 ++++++++++++++++++++++++ .github/workflows/tests.yml | 28 ++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..bc0a0ff --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,24 @@ +name: Publish gem to GitHub package registry + +on: + push: + tags: + - v* + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Ruby + uses: gocardless/github-actions/shared/actions/ruby-bundle-install@master + with: + known_hosts: ${{ secrets.KNOWN_HOSTS_GITHUB_KEY }} + robot_ssh_key: ${{ secrets.ROBOT_READONLY_SSH_KEY }} + token: ${{ secrets.ROBOT_READONLY_PACKAGE_READER }} + - name: Publish Gem + uses: gocardless/github-actions/shared/actions/publish-internal-gem@master + with: + token: ${{ secrets.GITHUB_TOKEN }} + known_hosts: ${{ secrets.KNOWN_HOSTS_GITHUB_KEY }} + robot_ssh_key: ${{ secrets.ROBOT_READONLY_SSH_KEY }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..dd214fa --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,28 @@ +name: tests +on: push + +jobs: + test_and_lint: + runs-on: ubuntu-latest + strategy: + matrix: + ruby_version: + - '2.6' + - '2.7' + - '3.0' + steps: + - uses: actions/checkout@v3.1.0 + - uses: gocardless/github-actions/shared/actions/ruby-bundle-install@master + with: + known_hosts: ${{ secrets.KNOWN_HOSTS_GITHUB_KEY }} + robot_ssh_key: ${{ secrets.ROBOT_READONLY_SSH_KEY }} + token: ${{ secrets.ROBOT_READONLY_PACKAGE_READER }} + ruby_version: ${{ matrix.ruby_version }} + - name: Run specs + run: RUBYOPT="-W0" bundle exec rspec --format progress --format RSpec::Github::Formatter -o /tmp/rspec.xml + - name: Rubocop + run: bundle exec rubocop --extra-details --display-style-guide --parallel --force-exclusion + - uses: actions/upload-artifact@v2 + if: failure() + with: + path: /tmp/ci_artifacts/