Change CI concurrency policy to not queue on main (#8530)
[cvc5.git] / .github / workflows / ci.yml
1 on: [push, pull_request]
2 name: CI
3
4 jobs:
5 build:
6 strategy:
7 matrix:
8 include:
9 - name: ubuntu:production
10 os: ubuntu-latest
11 config: production --auto-download --all-bindings --editline --docs
12 cache-key: production
13 strip-bin: strip
14 python-bindings: true
15 build-documentation: true
16 check-examples: true
17 binary-name: cvc5-Linux
18 exclude_regress: 3-4
19 run_regression_args: --tester base --tester model --tester synth --tester abduct --tester dump
20
21 - name: macos:production
22 os: macos-11
23 config: production --auto-download --python-bindings --editline
24 cache-key: production
25 strip-bin: strip
26 python-bindings: true
27 check-examples: true
28 binary-name: cvc5-macOS
29 exclude_regress: 3-4
30 run_regression_args: --tester base --tester model --tester synth --tester abduct --tester dump
31
32 - name: win64:production
33 os: ubuntu-latest
34 config: production --auto-download --win64
35 cache-key: productionwin64
36 strip-bin: x86_64-w64-mingw32-strip
37 windows-build: true
38 binary-name: cvc5-Win64.exe
39 binary-ext: .exe
40
41 - name: ubuntu:production-clang
42 os: ubuntu-18.04
43 env: CC=clang CXX=clang++
44 config: production --auto-download --no-poly
45 cache-key: productionclang
46 check-examples: true
47 exclude_regress: 3-4
48 run_regression_args: --tester base --tester model --tester synth --tester abduct --tester dump
49
50 - name: ubuntu:production-dbg
51 os: ubuntu-18.04
52 config: production --auto-download --assertions --tracing --unit-testing --all-bindings --editline
53 cache-key: dbg
54 exclude_regress: 3-4
55 run_regression_args: --tester base --tester model --tester synth --tester abduct --tester proof --tester dump
56 python-bindings: true
57
58 - name: ubuntu:production-dbg-clang
59 os: ubuntu-latest
60 env: CC=clang CXX=clang++
61 config: production --auto-download --assertions --tracing --cln --gpl
62 cache-key: dbgclang
63 exclude_regress: 3-4
64 run_regression_args: --tester base --tester model --tester synth --tester abduct --tester unsat-core --tester dump
65
66 name: ${{ matrix.name }}
67 runs-on: ${{ matrix.os }}
68
69 # cancel already running jobs for the same branch/pr/tag
70 concurrency:
71 group: build-${{ github.ref }}-${{ matrix.name }}-${{ github.ref != 'refs/heads/main' || github.run_id }}
72 cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
73
74 steps:
75
76 - uses: actions/checkout@v2
77
78 - name: Install dependencies
79 uses: ./.github/actions/install-dependencies
80 with:
81 with-documentation: ${{ matrix.build-documentation }}
82 with-python-bindings: ${{ matrix.python-bindings }}
83 windows-build: ${{ matrix.windows-build }}
84
85 - name: Setup caches
86 uses: ./.github/actions/setup-cache
87 with:
88 cache-key: ${{ matrix.cache-key }}
89
90 - name: Configure and build
91 id: configure-and-build
92 uses: ./.github/actions/configure-and-build
93 with:
94 configure-env: ${{ matrix.env }}
95 configure-config: ${{ matrix.config }}
96 build-shared: ${{ matrix.build-shared }}
97 build-static: ${{ matrix.build-static }}
98 strip-bin: ${{ matrix.strip-bin }}
99
100 - name: ccache Statistics
101 run: ccache -s
102
103 - name: Run tests
104 if: matrix.run_regression_args
105 uses: ./.github/actions/run-tests
106 with:
107 build-dir: ${{ steps.configure-and-build.outputs.shared-build-dir }}
108 check-examples: ${{ matrix.check-examples }}
109 check-python-bindings: ${{ matrix.python-bindings }}
110 regressions-args: ${{ matrix.run_regression_args }}
111 regressions-exclude: ${{ matrix.exclude_regress }}
112
113 - name: Run tests
114 if: matrix.run_regression_args
115 uses: ./.github/actions/run-tests
116 with:
117 build-dir: ${{ steps.configure-and-build.outputs.static-build-dir }}
118 check-examples: false
119 check-install: false
120 check-python-bindings: false
121 regressions-args: ${{ matrix.run_regression_args }}
122 regressions-exclude: 1-4
123
124 - name: Build documentation
125 if: matrix.build-documentation
126 uses: ./.github/actions/build-documentation
127 with:
128 build-dir: ${{ steps.configure-and-build.outputs.shared-build-dir }}
129
130 - name: Add binary to latest and release
131 if: matrix.binary-name && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))
132 uses: ./.github/actions/store-binary
133 with:
134 binary: ${{ steps.configure-and-build.outputs.static-build-dir }}/bin/cvc5${{ matrix.binary-ext }}
135 binary-name: ${{ matrix.binary-name }}
136 # when using GITHUB_TOKEN, no further workflows are triggered
137 github-token-latest: ${{ secrets.GITHUB_TOKEN }}
138 github-token-release: ${{ secrets.ACTION_USER_TOKEN }}
139
140 update-pr:
141 runs-on: ubuntu-latest
142 if: github.repository == 'cvc5/cvc5' && github.event_name == 'push' && github.ref == 'refs/heads/main'
143 concurrency:
144 group: update-pr
145 steps:
146 - name: Automatically update PR
147 uses: adRise/update-pr-branch@v0.6.0
148 with:
149 token: ${{ secrets.ACTION_USER_TOKEN }}
150 base: 'main'
151 sort: 'created'
152 direction: 'asc'
153 required_approval_count: 1