mirror of
https://github.com/iustin/mt-st.git
synced 2026-04-23 13:10:28 +00:00
The embedding of tests in the Makefile works only for that is there today - a few `--version` and `stinit -p` calls. For expanding the test coverage, as much as it can be done for `mt`, let's use a proper shell test runner. `shelltestrunner` is available in Debian/Ubuntu, so it's likely to be available in other distributions too, and as such should not be a big barrier to contribution.
71 lines
1.5 KiB
YAML
71 lines
1.5 KiB
YAML
on:
|
|
# Trigger the workflow on push or
|
|
# pull request, but only for the
|
|
# master branch.
|
|
push:
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
# Weekly run to account for
|
|
# changed dependencies.
|
|
schedule:
|
|
- cron: '17 04 * * 0'
|
|
|
|
name: CI
|
|
jobs:
|
|
build:
|
|
name: Build and test
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest]
|
|
compiler: ['gcc', 'clang']
|
|
fail-fast: false
|
|
env:
|
|
CC: ${{ matrix.compiler }}
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Build the code
|
|
run: make
|
|
|
|
- name: Test creating the release archive
|
|
run: make distcheck
|
|
|
|
coverage:
|
|
name: Check code coverage
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
CC: gcc
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Install dependencies
|
|
run: sudo apt-get install -yy shelltestrunner
|
|
|
|
- name: Build the code
|
|
run: make CFLAGS=-coverage
|
|
|
|
- name: Run tests under coverage
|
|
run: make check
|
|
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v1
|
|
with:
|
|
name: codecov-gcc
|
|
#fail_ci_if_error: true
|
|
path_to_write_report: ./codecov-report.txt
|
|
#verbose: true
|
|
|
|
- name: Archive code coverage result
|
|
uses: 'actions/upload-artifact@v2'
|
|
with:
|
|
name: code-coverage-gcc
|
|
path: codecov-report.txt
|