CI #30
This file contains 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 | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: "20 8 * * *" | |
workflow_dispatch: | |
inputs: | |
head: | |
description: "Commit reference at which to run tests" | |
required: false | |
base: | |
description: "Commit reference from which to evaluate diffs" | |
required: false | |
flags: | |
description: "Extra flags to pass to toys ci" | |
required: false | |
jobs: | |
CI: | |
if: ${{ github.repository == 'googleapis/google-cloud-ruby' }} | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-latest | |
ruby: "2.7" | |
task: "--test" | |
- os: ubuntu-latest | |
ruby: "3.0" | |
task: "--test" | |
- os: ubuntu-latest | |
ruby: "3.1" | |
task: "--test" | |
- os: ubuntu-latest | |
ruby: "3.2" | |
task: "--rubocop --build --test" | |
- os: ubuntu-latest | |
ruby: "3.2" | |
task: "--yard --linkinator" | |
- os: macos-latest | |
ruby: "3.2" | |
task: "--test" | |
- os: windows-latest | |
ruby: "3.2" | |
task: "--test" | |
- os: ubuntu-latest | |
ruby: "3.2" | |
task: "--rubocop-toplevel" | |
fail-fast: false | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Install Ruby ${{ matrix.ruby }} | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: "${{ matrix.ruby }}" | |
- name: Install NodeJS 16.x | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "16.x" | |
- name: Install tools | |
run: "gem install --no-document toys && npm install linkinator" | |
- name: Test ${{ matrix.task }} | |
run: | | |
toys ci -v ${{ matrix.task }} --github-event-name=${{ github.event_name }} --github-event-payload=${{ github.event_path }} ${{ github.event.inputs.flags }} | |
- name: Open Issues | |
if: ${{ failure() }} | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
toys ci report-failures --github-action-id=${{ github.run_id }} -v |