migrate inventory test #6
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 | ||
|
Check failure on line 1 in .github/workflows/ci.yml
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| # Cancel previous workflows on previous push | ||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | ||
| cancel-in-progress: true | ||
| # Global environment variables | ||
| env: | ||
| RUBY_VERSION: '3.3' | ||
| BUNDLER_VERSION: '2.7' | ||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| ruby-version: ['3.2', '3.3', '3.4'] | ||
| bundler-version: ${{ env.BUNDLER_VERSION }} | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| - name: Set up Ruby | ||
| uses: ruby/setup-ruby@v1 | ||
| with: | ||
| ruby-version: ${{ matrix.ruby-version }} | ||
| bundler-version: ${{ matrix.bundler-version }} | ||
| bundler-cache: true | ||
| - name: Install dependencies | ||
| run: | | ||
| bundle install | ||
| - name: Build gem | ||
| run: | | ||
| bundle exec rake build | ||
| - name: Run tests | ||
| run: | | ||
| bundle exec rake test | ||
| lint: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| - name: Set up Ruby | ||
| uses: ruby/setup-ruby@v1 | ||
| with: | ||
| ruby-version: ${{ env.RUBY_VERSION }} | ||
| bundler-version: ${{ env.BUNDLER_VERSION }} | ||
| bundler-cache: true | ||
| - name: Install dependencies | ||
| run: | | ||
| bundle install | ||
| - name: Run RuboCop with auto-correct | ||
| run: | | ||
| bundle exec rake rubocop:autocorrect | ||
| # TODO: Uncomment this when we have a way a fix for all RuboCop violations | ||
| # - name: Check for RuboCop violations | ||
| # run: | | ||
| # bundle exec rubocop --fail-level W | ||
| - name: Ensure no changes to git-tracked files | ||
| run: git --no-pager diff --exit-code | ||
| security: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| - name: Set up Ruby | ||
| uses: ruby/setup-ruby@v1 | ||
| with: | ||
| ruby-version: ${{ env.RUBY_VERSION }} | ||
| bundler-version: ${{ env.BUNDLER_VERSION }} | ||
| bundler-cache: true | ||
| - name: Install dependencies | ||
| run: | | ||
| bundle install | ||
| - name: Run bundle audit | ||
| run: | | ||
| bundle exec bundle audit check --update | ||
| gem-publish: | ||
| runs-on: ubuntu-latest | ||
| if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' | ||
| needs: [test, lint, security] | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Set up Ruby | ||
| uses: ruby/setup-ruby@v1 | ||
| with: | ||
| ruby-version: ${{ env.RUBY_VERSION }} | ||
| bundler-version: ${{ env.BUNDLER_VERSION }} | ||
| bundler-cache: true | ||
| - name: Install dependencies | ||
| run: | | ||
| bundle install | ||
| - name: Build gem | ||
| run: | | ||
| bundle exec rake build | ||
| # TODO: Uncomment this when we are ready to publish to RubyGems | ||
| # - name: Publish to RubyGems | ||
| # run: | | ||
| # gem push pkg/*.gem | ||
| # env: | ||
| # RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }} | ||