| 1 |
# |
| 2 |
# boxes - Command line filter to draw/remove ASCII boxes around text |
| 3 |
# Copyright (c) 1999-2024 Thomas Jensen and the boxes contributors |
| 4 |
# |
| 5 |
# This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public |
| 6 |
# License, version 3, as published by the Free Software Foundation. |
| 7 |
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied |
| 8 |
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
| 9 |
# details. |
| 10 |
# You should have received a copy of the GNU General Public License along with this program. |
| 11 |
# If not, see <https://www.gnu.org/licenses/>. |
| 12 |
#____________________________________________________________________________________________________________________ |
| 13 |
#==================================================================================================================== |
| 14 |
|
| 15 |
name: build |
| 16 |
|
| 17 |
on: [push, pull_request, workflow_dispatch] |
| 18 |
|
| 19 |
env: |
| 20 |
TERM: xterm-color |
| 21 |
|
| 22 |
jobs: |
| 23 |
build-linux: |
| 24 |
runs-on: ubuntu-latest |
| 25 |
steps: |
| 26 |
- uses: actions/checkout@v4 |
| 27 |
|
| 28 |
- name: add-packages |
| 29 |
run: | |
| 30 |
sudo apt-get update -y |
| 31 |
sudo apt-get install -y git flex bison libunistring-dev libpcre2-dev libncurses-dev diffutils vim-common lcov libcmocka-dev |
| 32 |
|
| 33 |
- name: make cov |
| 34 |
run: make cov |
| 35 |
|
| 36 |
- name: Run white-box tests |
| 37 |
run: make utest |
| 38 |
|
| 39 |
- name: Run sunny-day tests |
| 40 |
run: make covtest-sunny |
| 41 |
|
| 42 |
- name: Run black-box tests |
| 43 |
run: make covtest |
| 44 |
|
| 45 |
- name: Coveralls |
| 46 |
uses: coverallsapp/github-action@v2 |
| 47 |
with: |
| 48 |
github-token: ${{ secrets.GITHUB_TOKEN }} |
| 49 |
file: out/lcov-total.info |
| 50 |
format: lcov |
| 51 |
flag-name: run-linux |
| 52 |
parallel: true |
| 53 |
|
| 54 |
build-macos: |
| 55 |
runs-on: macos-13 |
| 56 |
env: |
| 57 |
BX_LEX: /usr/local/opt/flex/bin/flex |
| 58 |
BX_YACC: /usr/local/opt/bison/bin/bison |
| 59 |
steps: |
| 60 |
- uses: actions/checkout@v4 |
| 61 |
|
| 62 |
# We need to use GNU grep, sed, and xargs on macOS |
| 63 |
- name: add-packages |
| 64 |
run: | |
| 65 |
brew install flex bison diffutils lcov cmocka grep gnu-sed findutils |
| 66 |
echo '/usr/local/opt/grep/libexec/gnubin' >> $GITHUB_PATH |
| 67 |
echo '/usr/local/opt/gnu-sed/libexec/gnubin' >> $GITHUB_PATH |
| 68 |
echo '/usr/local/opt/findutils/libexec/gnubin' >> $GITHUB_PATH |
| 69 |
|
| 70 |
- name: make cov |
| 71 |
run: make cov |
| 72 |
|
| 73 |
- name: Run white-box tests |
| 74 |
run: make utest |
| 75 |
|
| 76 |
- name: Run sunny-day tests |
| 77 |
run: make covtest-sunny |
| 78 |
|
| 79 |
- name: Run black-box tests |
| 80 |
run: make covtest |
| 81 |
|
| 82 |
- name: Coveralls |
| 83 |
uses: coverallsapp/github-action@v2 |
| 84 |
with: |
| 85 |
github-token: ${{ secrets.GITHUB_TOKEN }} |
| 86 |
file: out/lcov-total.info |
| 87 |
format: lcov |
| 88 |
flag-name: run-macos |
| 89 |
parallel: true |
| 90 |
|
| 91 |
finish: |
| 92 |
needs: [build-linux, build-macos] |
| 93 |
if: ${{ always() }} |
| 94 |
runs-on: ubuntu-latest |
| 95 |
steps: |
| 96 |
- name: Coveralls Finished |
| 97 |
uses: coverallsapp/github-action@v2 |
| 98 |
with: |
| 99 |
parallel-finished: true |
| 100 |
carryforward: "run-linux,run-macos" |