Skip to content

Commit

Permalink
First shot at github actions (#7)
Browse files Browse the repository at this point in the history
* First shot at github actions

* Homegrown file_list to replace rake function

* This is embarassing...
  • Loading branch information
halfbyte authored Nov 27, 2024
1 parent feb0acc commit ae0e9ac
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 2 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/run_tests.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.1', '3.2', '3.3', 'head']

steps:
- uses: ConorMacBride/install-package@v1
with:
apt: default-jdk
- uses: actions/checkout@v4

- 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
16 changes: 14 additions & 2 deletions secretariat.gemspec
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
require_relative 'lib/secretariat/version'
require 'rake'

# Rolling my own file_list to not have to rely on rake
# as this breaks ruby-setup on GitHub actions
# This should be good enough for now, even though
# FileList does a lot more.
def file_list(*patterns)
patterns.map do |pattern|
Dir.glob(pattern)
end.flatten.reject do |file|
File.basename(file).start_with?(".")
end
end

Gem::Specification.new do |s|
s.name = 'secretariat'
s.version = Secretariat::VERSION
Expand All @@ -8,7 +20,7 @@ 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']
s.files = file_list('lib/**/*.rb', 'bin/*.jar', 'schemas/**/*', 'README.md')
s.homepage = 'https://github.com/halfbyte/ruby-secretariat'
s.license = 'Apache-2.0'

Expand Down

0 comments on commit ae0e9ac

Please sign in to comment.