v3.4.1 #513
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: Misc | |
on: [push, pull_request, merge_group] | |
concurrency: | |
group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }} | |
cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }} | |
permissions: | |
contents: read | |
jobs: | |
checks: | |
name: Miscellaneous checks | |
permissions: | |
contents: write # for Git to git push | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 | |
with: | |
token: ${{ (github.repository == 'ruby/ruby' && !startsWith(github.event_name, 'pull')) && secrets.MATZBOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} | |
- uses: ./.github/actions/setup/directories | |
with: | |
makeup: true | |
# Skip overwriting MATZBOT_GITHUB_TOKEN | |
checkout: '' # false (ref: https://github.com/actions/runner/issues/2238) | |
- name: Check if C-sources are US-ASCII | |
run: | | |
grep -r -n --include='*.[chyS]' --include='*.asm' $'[^\t-~]' -- . && exit 1 || : | |
- name: Check for trailing spaces | |
run: | | |
git grep -I -n $'[\t ]$' -- '*.rb' '*.[chy]' '*.rs' '*.yml' && exit 1 || : | |
git grep -n $'^[\t ][\t ]*$' -- '*.md' && exit 1 || : | |
- name: Check for bash specific substitution in configure.ac | |
run: | | |
git grep -n '\${[A-Za-z_0-9]*/' -- configure.ac && exit 1 || : | |
- name: Check for header macros | |
run: | | |
fail= | |
for header in ruby/*.h; do | |
git grep -l -F -e $header -e HAVE_`echo $header | tr a-z./ A-Z__` -- . > /dev/null && continue | |
fail=1 | |
echo $header | |
done | |
exit $fail | |
working-directory: include | |
- name: Generate docs | |
id: docs | |
run: | | |
ruby -W0 --disable-gems -I./lib tool/rdoc-srcdir -q --op html . | |
echo htmlout=ruby-html-${GITHUB_SHA:0:10} >> $GITHUB_OUTPUT | |
# Generate only when document commit/PR | |
if: >- | |
${{false | |
|| contains(github.event.head_commit.message, '[ruby/rdoc]') | |
|| contains(github.event.head_commit.message, '[DOC]') | |
|| contains(github.event.head_commit.message, 'Document') | |
|| contains(github.event.pull_request.title, '[DOC]') | |
|| contains(github.event.pull_request.title, 'Document') | |
|| contains(github.event.pull_request.labels.*.name, 'Documentation') | |
}} | |
- name: Upload docs | |
uses: actions/upload-artifact@v4 | |
with: | |
path: html | |
name: ${{ steps.docs.outputs.htmlout }} | |
if: ${{ steps.docs.outcome == 'success' }} | |
- uses: ./.github/actions/slack | |
with: | |
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot | |
if: ${{ failure() }} |