Skip to content

Commit

Permalink
Setup Github Actions CI
Browse files Browse the repository at this point in the history
- don't rely on Rake in Gemspec to avoid bootstrapping issues
  • Loading branch information
zealot128 committed Nov 27, 2024
1 parent feb0acc commit 3c9a946
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 2 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby

name: Ruby

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

permissions:
contents: read

jobs:
test:

runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['3.2.2', '3.3', head]

steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu' # See 'Supported distributions' for available options
java-version: '21'
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Run tests
run: bundle exec rake test
9 changes: 7 additions & 2 deletions secretariat.gemspec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require_relative 'lib/secretariat/version'
require 'rake'
#require 'rake'
Gem::Specification.new do |s|
s.name = 'secretariat'
s.version = Secretariat::VERSION
Expand All @@ -8,7 +8,12 @@ Gem::Specification.new do |s|
s.description = "a tool to help generate and validate ZUGFeRD invoice xml files"
s.authors = ["Jan Krutisch"]
s.email = '[email protected]'
s.files = FileList['lib/**/*.rb', 'bin/*.jar', 'schemas/**/*', 'README.md']

# Specify which files should be added to the gem when it is released.
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
s.files = Dir.chdir(File.expand_path('..', __FILE__)) do
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
end
s.homepage = 'https://github.com/halfbyte/ruby-secretariat'
s.license = 'Apache-2.0'

Expand Down

0 comments on commit 3c9a946

Please sign in to comment.