-
Notifications
You must be signed in to change notification settings - Fork 5
70 lines (61 loc) 路 2.05 KB
/
Copy pathtest.yml
File metadata and controls
70 lines (61 loc) 路 2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Tests
on:
pull_request:
paths-ignore:
- "*.md"
- "LICENSE.txt"
push:
branches:
- main
paths-ignore:
- "*.md"
- "LICENSE.txt"
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby_version: ["3.2", "3.3", "3.4", "4.0"]
gemfile:
- gemfiles/rails_7.1.gemfile
- gemfiles/rails_7.2.gemfile
- gemfiles/rails_8.1.gemfile
env:
RAILS_ENV: test
BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Ruby ${{ matrix.ruby_version }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
bundler-cache: true
- name: Run tests
run: bundle exec rake test
- name: Build and inspect the release artifact
if: matrix.ruby_version == '3.4' && matrix.gemfile == 'gemfiles/rails_8.1.gemfile'
run: |
gem build pricing_plans.gemspec --output pricing_plans-release.gem
ruby -rrubygems/package -e '
spec = Gem::Package.new(ARGV.fetch(0)).spec
required = %w[
lib/pricing_plans/feature_access.rb
lib/generators/pricing_plans/passes/passes_generator.rb
lib/generators/pricing_plans/passes/templates/add_feature_pass_limits.rb.erb
docs/08-feature-passes.md
lib/pricing_plans/models/feature_grant.rb
lib/pricing_plans/plan_owner_identity.rb
lib/generators/pricing_plans/grants/grants_generator.rb
]
missing = required - spec.files
abort "Missing packaged files: #{missing.join(", ")}" if missing.any?
' pricing_plans-release.gem
- name: Upload test results
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-results-ruby-${{ matrix.ruby_version }}-${{ matrix.gemfile }}
path: test/reports/
retention-days: 7