Merge pull request #338 from ruby-go-gem/feature/rubocop-on-rbs #458
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_h_to_go | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| types: | |
| - opened | |
| - synchronize | |
| - reopened | |
| paths: | |
| - ".github/workflows/ruby_h_to_go.yml" | |
| - "_tools/ruby_h_to_go/**" | |
| - "Gemfile" | |
| - "Gemfile.lock" | |
| defaults: | |
| run: | |
| working-directory: _tools/ruby_h_to_go/ | |
| jobs: | |
| generate-matrix: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| matrix: ${{ steps.set-matrix.outputs.matrix }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - id: set-matrix | |
| run: echo "matrix=$(cat matrix.json | jq -c)" >> $GITHUB_OUTPUT | |
| working-directory: .github/workflows/ | |
| test: | |
| name: "test (Go ${{ matrix.go }}, Ruby ${{ matrix.ruby }})" | |
| needs: | |
| - generate-matrix | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: ${{ fromJSON(needs.generate-matrix.outputs.matrix) }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version: ${{ matrix.go }} | |
| - uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: ${{ matrix.ruby }} | |
| bundler-cache: true | |
| - run: sudo apt-get update | |
| - run: sudo apt-get install -y universal-ctags | |
| - run: go install golang.org/x/tools/cmd/goimports@latest | |
| - run: bundle exec rspec | |
| - name: Slack Notification (not success) | |
| uses: act10ns/slack@v2 | |
| if: "! success()" | |
| continue-on-error: true | |
| with: | |
| status: ${{ job.status }} | |
| webhook-url: ${{ secrets.SLACK_WEBHOOK }} | |
| matrix: ${{ toJson(matrix) }} | |
| notify: | |
| needs: | |
| - test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Slack Notification (success) | |
| uses: act10ns/slack@v2 | |
| if: always() | |
| continue-on-error: true | |
| with: | |
| status: ${{ job.status }} | |
| webhook-url: ${{ secrets.SLACK_WEBHOOK }} |