Release 0.3.0 #35
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI/CD Pipeline | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| pull_request: | |
| # Run tests on ALL pull requests, regardless of target branch | |
| release: | |
| types: [ published ] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| strategy: | |
| matrix: | |
| ruby-version: ['3.2', '3.3'] | |
| steps: | |
| - 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: Install dependencies | |
| run: | | |
| bundle install --jobs 4 --retry 3 | |
| bundle list | |
| - name: Run tests | |
| run: bundle exec rake spec | |
| - name: Run CLI tests | |
| run: | | |
| # Test basic CLI functionality with bundler context | |
| bundle exec ruby -Ilib exe/issuer --version | |
| bundle exec ruby -Ilib exe/issuer --help | |
| bundle exec ruby -Ilib exe/issuer examples/minimal-example.yml --dry | |
| gem-build: | |
| runs-on: ubuntu-latest | |
| needs: test | |
| if: github.event_name == 'release' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.2' | |
| bundler-cache: true | |
| - name: Build gem | |
| run: gem build issuer.gemspec | |
| # - name: Publish to RubyGems | |
| # run: | | |
| # mkdir -p ~/.gem | |
| # echo ":rubygems_api_key: ${{ secrets.RUBYGEMS_API_KEY }}" > ~/.gem/credentials | |
| # chmod 0600 ~/.gem/credentials | |
| # gem push issuer-*.gem | |
| # env: | |
| # RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }} | |
| docker-build: | |
| runs-on: ubuntu-latest | |
| needs: test | |
| if: github.event_name == 'release' || github.ref == 'refs/heads/main' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build Docker image (test only) | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| push: false | |
| tags: docopslab/issuer:test | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Test Docker image | |
| run: | | |
| docker run --rm -v $(pwd):/workdir docopslab/issuer:test --version | |
| docker run --rm -v $(pwd):/workdir docopslab/issuer:test examples/minimal-example.yml --dry | |
| # integration-test job removed since Docker testing is now handled in docker-build job | |
| # This avoids trying to pull from DockerHub when we're doing manual publishing |