Skip to content

portable-ruby 3.3.1 #45

portable-ruby 3.3.1

portable-ruby 3.3.1 #45

Workflow file for this run

name: CI
on:
push:
branches: master
pull_request:
permissions:
contents: read
pull-requests: read
concurrency:
group: "${{ github.ref }}"
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
syntax:
runs-on: ubuntu-latest
steps:
- name: Set up Homebrew
uses: Homebrew/actions/setup-homebrew@master
- run: brew test-bot --only-tap-syntax
determine-workflow:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
outputs:
workflow: ${{ steps.determine-workflow.outputs.workflow }}
steps:
- name: Determine workflow
id: determine-workflow
run: |
if jq --exit-status 'any(.labels[].name; . == "build-deps")' <(
gh api \
--header 'Accept: application/vnd.github+json' \
--header 'X-GitHub-Api-Version: 2022-11-28' \
'/repos/{owner}/{repo}/pulls/${{ github.event.pull_request.number }}'
); then
echo "workflow=build-deps" >> "$GITHUB_OUTPUT"
else
echo "workflow=build" >> "$GITHUB_OUTPUT"
fi
env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ github.token }}
build-deps:
needs: [syntax, determine-workflow]
if: >
github.event_name == 'pull_request' &&
needs.determine-workflow.outputs.workflow == 'build-deps'
uses: ./.github/workflows/build-deps.yml
build:
needs: [syntax, determine-workflow]
if: >
github.event_name == 'pull_request' &&
needs.determine-workflow.outputs.workflow == 'build'
uses: ./.github/workflows/build.yml
# This job is used as a required status check, instead of requiring each build matrix element.
# When using ephemeral runners, the name of those runs change every time so they cannot be set as required.
conclusion:
needs: [build-deps, build]
runs-on: ubuntu-latest
if: always() && github.event_name == 'pull_request' && !cancelled()
steps:
- name: Result
run: |
${{ contains(fromJson('["success", "skipped"]'), needs.build-deps.result) }}
${{ contains(fromJson('["success", "skipped"]'), needs.build.result) }}