Skip to content

Regenerate OpenAPI spec with the hardened fondations schema #193

Regenerate OpenAPI spec with the hardened fondations schema

Regenerate OpenAPI spec with the hardened fondations schema #193

Workflow file for this run

name: "Clients Ruby"
on:
push:
branches: ['**']
paths:
- 'clients/ruby/**'
- 'commons/swagger/**'
- '.github/workflows/clients-ruby.yml'
tags:
- 'ruby-api-*-v*'
jobs:
rspec:
name: RSpec (Ruby ${{ matrix.ruby }})
if: github.ref_type != 'tag'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby: ['3.2', '3.3', '4.0']
steps:
- uses: actions/checkout@v7.0.1
- uses: ruby/setup-ruby@v1.321.0
with:
ruby-version: ${{ matrix.ruby }}
- name: commons
working-directory: clients/ruby/commons
run: bundle install && bundle exec rspec
- name: api_entreprise
working-directory: clients/ruby/api_entreprise
run: bundle install && bundle exec rspec
- name: api_particulier
working-directory: clients/ruby/api_particulier
run: bundle install && bundle exec rspec
freshness:
name: sync_commons & scaffold_resources freshness
if: github.ref_type != 'tag'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7.0.1
- uses: ruby/setup-ruby@v1.321.0
with:
ruby-version: '3.3'
- name: Verify vendored commons is up to date
run: clients/ruby/bin/sync_commons --check
- name: Verify scaffolded resources are up to date
run: clients/ruby/bin/scaffold_resources --api all --check
release:
name: Build & push to rubygems.org
if: github.ref_type == 'tag'
runs-on: ubuntu-latest
environment: rubygems
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v7.0.1
- name: Resolve gem from tag
id: gem
run: |
case "$GITHUB_REF_NAME" in
ruby-api-entreprise-v*)
echo "name=api_entreprise" >>"$GITHUB_OUTPUT"
echo "dir=clients/ruby/api_entreprise" >>"$GITHUB_OUTPUT"
;;
ruby-api-particulier-v*)
echo "name=api_particulier" >>"$GITHUB_OUTPUT"
echo "dir=clients/ruby/api_particulier" >>"$GITHUB_OUTPUT"
;;
*)
echo "Unsupported tag: $GITHUB_REF_NAME" >&2
exit 1
;;
esac
- uses: ruby/setup-ruby@v1.321.0
with:
ruby-version: '3.3'
bundler-cache: true
working-directory: ${{ steps.gem.outputs.dir }}
- name: Verify tag version matches gemspec version
working-directory: ${{ steps.gem.outputs.dir }}
run: |
tag_version="${GITHUB_REF_NAME##*-v}"
gem_version=$(ruby -e 'puts Gem::Specification.load("${{ steps.gem.outputs.name }}.gemspec").version')
if [ "$tag_version" != "$gem_version" ]; then
echo "Tag version '$tag_version' does not match gemspec version '$gem_version'" >&2
exit 1
fi
echo "Releasing ${{ steps.gem.outputs.name }} $gem_version"
- name: Run rspec
working-directory: ${{ steps.gem.outputs.dir }}
run: bundle exec rspec
- uses: rubygems/release-gem@v1.4.0
with:
working-directory: ${{ steps.gem.outputs.dir }}