summaryrefslogtreecommitdiff
path: root/.github/workflows/parse_y.yml
blob: a1035ef451dd8259575f6e24de07b4805a7867aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: parse.y
on:
  push:
    paths-ignore:
      - 'doc/**'
      - '**/man/*'
      - '**.md'
      - '**.rdoc'
      - '**/.document'
      - '.*.yml'
  pull_request:
    paths-ignore:
      - 'doc/**'
      - '**/man/*'
      - '**.md'
      - '**.rdoc'
      - '**/.document'
      - '.*.yml'
  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:
  make:
    strategy:
      matrix:
        include:
          - test_task: check
          - test_task: test-bundler-parallel
          - test_task: test-bundled-gems
      fail-fast: false

    env:
      GITPULLOPTIONS: --no-tags origin ${{ github.ref }}
      RUBY_DEBUG: ci
      SETARCH: ${{ matrix.arch && format('setarch {0}', matrix.arch) }}

    runs-on: ubuntu-22.04

    if: >-
      ${{!(false
      || contains(github.event.head_commit.message, '[DOC]')
      || contains(github.event.pull_request.title, '[DOC]')
      || contains(github.event.pull_request.labels.*.name, 'Documentation')
      || (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]')
      )}}

    steps:
      - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
        with:
          sparse-checkout-cone-mode: false
          sparse-checkout: /.github

      - uses: ./.github/actions/setup/ubuntu

      - uses: ruby/setup-ruby@ab177d40ee5483edb974554986f56b33477e21d0 # v1.265.0
        with:
          ruby-version: '3.1'
          bundler: none

      - uses: ./.github/actions/setup/directories
        with:
          srcdir: src
          builddir: build
          makeup: true
          clean: true
          dummy-files: ${{ matrix.test_task == 'check' }}

      - name: Run configure
        run: ../src/configure -C --disable-install-doc cppflags=-DRUBY_DEBUG --with-parser=parse.y

      - run: make

      - run: make TESTRUN_SCRIPT='-renvutil -v -e "exit EnvUtil.current_parser == %[parse.y]"' run
        env:
          RUNOPT0: -I$(tooldir)/lib

      - name: make ${{ matrix.test_task }}
        run: make -s ${{ matrix.test_task }} RUN_OPTS="$RUN_OPTS" SPECOPTS="$SPECOPTS"
        env:
          RUBY_TESTOPTS: ${{ matrix.testopts }}
          EXCLUDES: '../src/test/.excludes-parsey'
          RUN_OPTS: ${{ matrix.run_opts || '--parser=parse.y' }}
          SPECOPTS: ${{ matrix.specopts || '-T --parser=parse.y' }}
          TEST_BUNDLED_GEMS_ALLOW_FAILURES: ''

      - uses: ./.github/actions/slack
        with:
          label: ${{ matrix.run_opts }}
          SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
        if: ${{ failure() }}

defaults:
  run:
    working-directory: build