Allow support/readonly roles to access AWS Sustainability #1485
Workflow file for this run
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: "Ruby CI" | |
| on: | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - "**.rb" | |
| - "**Gemfile" | |
| - "**Rakefile" | |
| - ".github/workflows/ruby-ci.yml" | |
| - "infra/**" | |
| - ".mise.toml" | |
| merge_group: | |
| types: [checks_requested] | |
| push: | |
| branches: [main] | |
| jobs: | |
| setup: | |
| name: "Setup" | |
| runs-on: ubuntu-24.04-arm | |
| outputs: | |
| ruby-version: ${{ steps.set-ruby-version.outputs.ruby-version }} | |
| spec-matrix: ${{ steps.build-matrix.outputs.spec-matrix }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Initialise mise and cache `hcl2json` | |
| uses: jdx/mise-action@6d1e696aa24c1aa1bcc1adea0212707c71ab78a8 # v3.6.1 | |
| with: | |
| install_args: hcl2json | |
| - name: Set Ruby version | |
| id: set-ruby-version | |
| run: | | |
| echo "ruby-version=$(mise current ruby)" >> "$GITHUB_OUTPUT" | |
| - name: Build spec matrix | |
| id: build-matrix | |
| run: | | |
| spec_dirs_json="$(find . -type d -name 'spec' -not -path '*vendor*' | sed 's|/spec$||g' | jq -Rnc '[inputs]')" | |
| echo "spec-matrix=$spec_dirs_json" >> "$GITHUB_OUTPUT" | |
| ruby-lint: | |
| name: "Ruby Lint" | |
| runs-on: ubuntu-24.04-arm | |
| needs: setup | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Install Ruby and gems at root | |
| uses: ruby/setup-ruby@09a7688d3b55cf0e976497ff046b70949eeaccfd # v1.288.0 | |
| with: | |
| bundler-cache: true | |
| ruby-version: ${{needs.setup.outputs.ruby-version}} | |
| - name: Run rubocop | |
| run: make lint_ruby | |
| ruby-spec: | |
| name: "Rspec" | |
| runs-on: ubuntu-24.04-arm | |
| needs: setup | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| spec_target: ${{ fromJSON(needs.setup.outputs.spec-matrix) }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Set up hcl2json | |
| uses: jdx/mise-action@6d1e696aa24c1aa1bcc1adea0212707c71ab78a8 # v3.6.1 | |
| with: | |
| install_args: hcl2json | |
| - name: "Install Ruby and gems in ${{matrix.spec_target}}" | |
| uses: ruby/setup-ruby@09a7688d3b55cf0e976497ff046b70949eeaccfd # v1.288.0 | |
| with: | |
| bundler-cache: true | |
| ruby-version: ${{needs.setup.outputs.ruby-version}} | |
| working-directory: "${{matrix.spec_target}}" | |
| - name: Run specs | |
| run: | | |
| cd "${{matrix.spec_target}}" | |
| bundle exec rspec |