From 3b27faa369aaa27307f94a9300849727427e86c8 Mon Sep 17 00:00:00 2001 From: nvim Date: Tue, 29 Oct 2024 15:35:23 +0100 Subject: [PATCH] Add publish gem and quatlity control actions Ref: https://github.com/hl7au/au-fhir-inferno/issues/2 --- .github/workflows/publish-gem.yaml | 18 +++++++++++++++ .github/workflows/quality-control.yaml | 15 ++++++++++++ Gemfile | 8 ++++--- Gemfile.lock | 24 +++++++++++++++++++ Makefile | 32 ++++++++++++++++++++++++++ 5 files changed, 94 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/publish-gem.yaml create mode 100644 .github/workflows/quality-control.yaml create mode 100644 Makefile diff --git a/.github/workflows/publish-gem.yaml b/.github/workflows/publish-gem.yaml new file mode 100644 index 0000000..c3c075f --- /dev/null +++ b/.github/workflows/publish-gem.yaml @@ -0,0 +1,18 @@ +name: Publish Gem +on: + release: + types: [published] + workflow_dispatch: +jobs: + build: + runs-on: ubuntu-latest + permissions: + packages: write + contents: read + steps: + - uses: actions/checkout@v2 + - name: Build and publish gem + uses: jstastny/publish-gem-to-github@master + with: + token: ${{ secrets.GITHUB_TOKEN }} + owner: ${{ github.repository_owner }} \ No newline at end of file diff --git a/.github/workflows/quality-control.yaml b/.github/workflows/quality-control.yaml new file mode 100644 index 0000000..b13d4a3 --- /dev/null +++ b/.github/workflows/quality-control.yaml @@ -0,0 +1,15 @@ +name: Automated Quality Control +on: push +jobs: + Spec: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Setup environment + run: make setup + - name: Run RuboCop + run: make rubocop + - name: Run Spec + run: make tests diff --git a/Gemfile b/Gemfile index e698f56..ba5418a 100644 --- a/Gemfile +++ b/Gemfile @@ -1,11 +1,13 @@ # frozen_string_literal: true -source "https://rubygems.org" +source 'https://rubygems.org' gemspec group :development, :test do gem 'debug' - gem 'ips_test_kit', '~> 0.10.2' - gem 'ipa_test_kit', '~> 0.4.1' end + +gem 'ipa_test_kit', '~> 0.4.1' +gem 'ips_test_kit', '~> 0.10.2' +gem 'rubocop', '~> 1.63.2' diff --git a/Gemfile.lock b/Gemfile.lock index ebb3b2d..660d501 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -16,6 +16,7 @@ GEM addressable (2.8.6) public_suffix (>= 2.0.2, < 6.0) aes_key_wrap (1.1.0) + ast (2.4.2) base62-rb (0.3.1) base64 (0.2.0) bcp47 (0.3.3) @@ -171,6 +172,7 @@ GEM irb (1.13.1) rdoc (>= 4.0.0) reline (>= 0.4.2) + json (2.7.4) json-jwt (1.15.3.1) activesupport (>= 4.2) aes_key_wrap @@ -180,6 +182,7 @@ GEM base64 kramdown (2.4.0) rexml + language_server-protocol (3.17.0.3) method_source (1.1.0) mime-types (3.5.2) mime-types-data (~> 3.2015) @@ -219,6 +222,10 @@ GEM multi_xml (~> 0.5) rack (>= 1.2, < 4) oj (3.11.0) + parallel (1.26.3) + parser (3.3.5.0) + ast (~> 2.4.1) + racc pastel (0.8.0) tty-color (~> 0.5) pry (0.14.2) @@ -234,11 +241,13 @@ GEM nio4r (~> 2.0) racc (1.8.0) rack (2.2.9) + rainbow (3.1.1) rake (13.2.1) rdoc (6.7.0) psych (>= 4.0.0) redis-client (0.22.2) connection_pool + regexp_parser (2.9.2) reline (0.5.8) io-console (~> 0.5) rest-client (2.1.0) @@ -262,6 +271,20 @@ GEM diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-support (3.13.1) + rubocop (1.63.5) + json (~> 2.3) + language_server-protocol (>= 3.17.0) + parallel (~> 1.10) + parser (>= 3.3.0.2) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.31.1, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.32.3) + parser (>= 3.3.1.0) + ruby-progressbar (1.13.0) ruby2_keywords (0.0.5) sequel (5.42.0) sidekiq (7.2.4) @@ -329,6 +352,7 @@ DEPENDENCIES ipa_test_kit (~> 0.4.1) ips_test_kit (~> 0.10.2) rspec (~> 3.10) + rubocop (~> 1.63.2) webmock (~> 3.11) BUNDLED WITH diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..6d3a70a --- /dev/null +++ b/Makefile @@ -0,0 +1,32 @@ +compose = docker compose +inferno = run inferno + +.PHONY: pull build up stop down migrate setup run tests rubocop + +pull: + $(compose) pull + +build: + $(compose) build + +up: + $(compose) up + +stop: + $(compose) stop + +down: + $(compose) down + +migrate: + $(compose) $(inferno) bundle exec inferno migrate + +setup: pull build migrate + +run: build up + +tests: + $(compose) $(inferno) bundle exec rspec + +rubocop: + $(compose) $(inferno) rubocop \ No newline at end of file