summaryrefslogtreecommitdiffhomepage
path: root/.github/workflows/ci.yml
blob: db6b52c28aa3ea43676f41b6ab8e4575271e10af (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
name: ci

on:
  push:
    branches: [main]
  pull_request:

permissions:
  contents: read

jobs:
  format:
    name: clang-format
    runs-on: ubuntu-latest
    env:
      # Pinned on purpose: clang-format moves line breaks between releases, and
      # a gate that goes red on a tool upgrade says nothing about the change.
      # Bump this together with .clang-format.
      CLANG_FORMAT_VERSION: 23.1.5
    steps:
      # v7.0.1, pinned to a commit: a tag can be repointed at other code.
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
        with:
          persist-credentials: false
      - run: pip install "clang-format==$CLANG_FORMAT_VERSION"
      - run: clang-format --dry-run --Werror whoson.c

  makefile:
    name: makefile
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
        with:
          persist-credentials: false
      # The build itself needs z/OS and IBM Open XL, so this job only
      # proves that the Makefile parses under GNU make and that each recipe is
      # well formed.  -n runs nothing.
      - run: make -n all
      - run: make -n install check list

  port:
    name: zopen port
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
        with:
          persist-credentials: false
      # buildenv is sourced by zopen's shell, and the port's stable tarball
      # must be the release this tree claims to be.
      - run: sh -n buildenv
      - name: buildenv matches VERSION
        run: |
          version=$(sed -n 's/^VERSION[[:space:]]*=[[:space:]]*//p' Makefile)
          port=$(sed -n 's/^WHOSON_VERSION="\(.*\)"/\1/p' buildenv)
          if [ "$version" != "$port" ]; then
              echo "buildenv $port != Makefile $version" >&2
              exit 1
          fi