n2n/.github/workflows/tests.yml

411 lines
9.5 KiB
YAML
Raw Normal View History

added test framework and code coverage reporting (#797) * Add a simple test framework * Add a code coverage report example oneliner * Move the coverage report into a separate directory * Add a github action to run tests and publish a branch with the coverage report * Fix: Missing job separator * Fix: remember to actually run configure * Fix: Gotta autogen before I configure * Dont try to upload coverage report unless this is a push * Clearly show the git ref tested in the coverage report * Add a test for the various transforms * Add tests for the elliptic curve and pearson hash * Ensure we ignore new generated output * Remove unneeded boilerplate from the compression tests * Add an example of a test of the encoded wire packets * Ensure that correctly testable data is output even when zstd is not compiled * Factor test runner out into its own script and attempt to add it to the cmake file * Tell cmake about a new object file * Stop trying to make Cmake work... * Stop trying to make cmake work, round 2 * In the middle of a thousand lines of cmake output was one important one - windows could not find assert() - try again * Try again to plumb the tests into cmake * Add missing library to our superset install line * Fix build error when libcap-dev is installed * Switch to using artifact uploads instead of pages to store/show the coverage report * Fix artifact upload yaml * Upload coverage report to codecov * Fix codecov - clearly it doesnt do a recursive search for coverage files * Fix codecov - my hopeful use of a list of directories didnt work * Fix codecov - unfortunately, it doesnt just consume the coverage data and needs us to generate the gcov output * Fix codecov - nope, it still doesnt recursively search * Fix codecov - it really helps if I run the gcov data generator * Add a simple matrix build * Fix older ubuntu versions of gcovr that do not support the '--html-title' option * Ensure we use gcover options that are identical on older ubuntu * Improve coverage generation and required build packages
2021-09-27 11:41:06 +02:00
name: Testing
added test framework and code coverage reporting (#797) * Add a simple test framework * Add a code coverage report example oneliner * Move the coverage report into a separate directory * Add a github action to run tests and publish a branch with the coverage report * Fix: Missing job separator * Fix: remember to actually run configure * Fix: Gotta autogen before I configure * Dont try to upload coverage report unless this is a push * Clearly show the git ref tested in the coverage report * Add a test for the various transforms * Add tests for the elliptic curve and pearson hash * Ensure we ignore new generated output * Remove unneeded boilerplate from the compression tests * Add an example of a test of the encoded wire packets * Ensure that correctly testable data is output even when zstd is not compiled * Factor test runner out into its own script and attempt to add it to the cmake file * Tell cmake about a new object file * Stop trying to make Cmake work... * Stop trying to make cmake work, round 2 * In the middle of a thousand lines of cmake output was one important one - windows could not find assert() - try again * Try again to plumb the tests into cmake * Add missing library to our superset install line * Fix build error when libcap-dev is installed * Switch to using artifact uploads instead of pages to store/show the coverage report * Fix artifact upload yaml * Upload coverage report to codecov * Fix codecov - clearly it doesnt do a recursive search for coverage files * Fix codecov - my hopeful use of a list of directories didnt work * Fix codecov - unfortunately, it doesnt just consume the coverage data and needs us to generate the gcov output * Fix codecov - nope, it still doesnt recursively search * Fix codecov - it really helps if I run the gcov data generator * Add a simple matrix build * Fix older ubuntu versions of gcovr that do not support the '--html-title' option * Ensure we use gcover options that are identical on older ubuntu * Improve coverage generation and required build packages
2021-09-27 11:41:06 +02:00
on:
push:
pull_request:
jobs:
smoketest:
name: Smoke test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run minimal test set
run: |
./autogen.sh
./configure
make test
Basic C Code lint checker and shell checker (#859) * Factor build packages out into a more maintainable list * Create a location for scripts to live * Provide a make target to return the source dir as close as reasonable to the original distributed state * Add a code lint step, checking the coding style * Change test harness as recommended by shellcheck * Ensure we actually have the linter tool installed * Use the correct directory for cmake to run the tests * Adjust for the older uncrustify in the current github ubuntu-latest * Make one file pass the linter * Integrate the lint with the existing test workflow * Add files with minimal changes needed to the linter * Add more files with minimal changes needed to the linter * Dont build binaries if we fail the lint test * Update the phony targets with the lint steps * Ensure the flake8 package is installed in the new lint workflow job * Use the makefile to drive the packages needed to install for linting * No need to add dependancies on lint, just rely on the workflow status to show failure * Update the scripts dir README to reflect current assumptions * Rename and briefly document the indent.sh script * Fix the ignore to ignore the right Makefile * Rename the test_harness script to make it clear it is a shell script * Provide a master lint make target and add a shell script lint tool * Elminate stray tabs * Drop include/auth.h from linter - there are inconsistant results with function definitions when using the current uncrustify rules
2021-10-23 21:36:18 +02:00
lint:
name: Code syntax
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Make the makefiles
run: |
./autogen.sh
./configure
- name: Install essential
run: |
make build-dep
- name: Run the lint tools
run: |
make lint
test_linux:
needs: smoketest
name: Test Linux
added test framework and code coverage reporting (#797) * Add a simple test framework * Add a code coverage report example oneliner * Move the coverage report into a separate directory * Add a github action to run tests and publish a branch with the coverage report * Fix: Missing job separator * Fix: remember to actually run configure * Fix: Gotta autogen before I configure * Dont try to upload coverage report unless this is a push * Clearly show the git ref tested in the coverage report * Add a test for the various transforms * Add tests for the elliptic curve and pearson hash * Ensure we ignore new generated output * Remove unneeded boilerplate from the compression tests * Add an example of a test of the encoded wire packets * Ensure that correctly testable data is output even when zstd is not compiled * Factor test runner out into its own script and attempt to add it to the cmake file * Tell cmake about a new object file * Stop trying to make Cmake work... * Stop trying to make cmake work, round 2 * In the middle of a thousand lines of cmake output was one important one - windows could not find assert() - try again * Try again to plumb the tests into cmake * Add missing library to our superset install line * Fix build error when libcap-dev is installed * Switch to using artifact uploads instead of pages to store/show the coverage report * Fix artifact upload yaml * Upload coverage report to codecov * Fix codecov - clearly it doesnt do a recursive search for coverage files * Fix codecov - my hopeful use of a list of directories didnt work * Fix codecov - unfortunately, it doesnt just consume the coverage data and needs us to generate the gcov output * Fix codecov - nope, it still doesnt recursively search * Fix codecov - it really helps if I run the gcov data generator * Add a simple matrix build * Fix older ubuntu versions of gcovr that do not support the '--html-title' option * Ensure we use gcover options that are identical on older ubuntu * Improve coverage generation and required build packages
2021-09-27 11:41:06 +02:00
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os:
- ubuntu-20.04
added test framework and code coverage reporting (#797) * Add a simple test framework * Add a code coverage report example oneliner * Move the coverage report into a separate directory * Add a github action to run tests and publish a branch with the coverage report * Fix: Missing job separator * Fix: remember to actually run configure * Fix: Gotta autogen before I configure * Dont try to upload coverage report unless this is a push * Clearly show the git ref tested in the coverage report * Add a test for the various transforms * Add tests for the elliptic curve and pearson hash * Ensure we ignore new generated output * Remove unneeded boilerplate from the compression tests * Add an example of a test of the encoded wire packets * Ensure that correctly testable data is output even when zstd is not compiled * Factor test runner out into its own script and attempt to add it to the cmake file * Tell cmake about a new object file * Stop trying to make Cmake work... * Stop trying to make cmake work, round 2 * In the middle of a thousand lines of cmake output was one important one - windows could not find assert() - try again * Try again to plumb the tests into cmake * Add missing library to our superset install line * Fix build error when libcap-dev is installed * Switch to using artifact uploads instead of pages to store/show the coverage report * Fix artifact upload yaml * Upload coverage report to codecov * Fix codecov - clearly it doesnt do a recursive search for coverage files * Fix codecov - my hopeful use of a list of directories didnt work * Fix codecov - unfortunately, it doesnt just consume the coverage data and needs us to generate the gcov output * Fix codecov - nope, it still doesnt recursively search * Fix codecov - it really helps if I run the gcov data generator * Add a simple matrix build * Fix older ubuntu versions of gcovr that do not support the '--html-title' option * Ensure we use gcover options that are identical on older ubuntu * Improve coverage generation and required build packages
2021-09-27 11:41:06 +02:00
- ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Install essential
added test framework and code coverage reporting (#797) * Add a simple test framework * Add a code coverage report example oneliner * Move the coverage report into a separate directory * Add a github action to run tests and publish a branch with the coverage report * Fix: Missing job separator * Fix: remember to actually run configure * Fix: Gotta autogen before I configure * Dont try to upload coverage report unless this is a push * Clearly show the git ref tested in the coverage report * Add a test for the various transforms * Add tests for the elliptic curve and pearson hash * Ensure we ignore new generated output * Remove unneeded boilerplate from the compression tests * Add an example of a test of the encoded wire packets * Ensure that correctly testable data is output even when zstd is not compiled * Factor test runner out into its own script and attempt to add it to the cmake file * Tell cmake about a new object file * Stop trying to make Cmake work... * Stop trying to make cmake work, round 2 * In the middle of a thousand lines of cmake output was one important one - windows could not find assert() - try again * Try again to plumb the tests into cmake * Add missing library to our superset install line * Fix build error when libcap-dev is installed * Switch to using artifact uploads instead of pages to store/show the coverage report * Fix artifact upload yaml * Upload coverage report to codecov * Fix codecov - clearly it doesnt do a recursive search for coverage files * Fix codecov - my hopeful use of a list of directories didnt work * Fix codecov - unfortunately, it doesnt just consume the coverage data and needs us to generate the gcov output * Fix codecov - nope, it still doesnt recursively search * Fix codecov - it really helps if I run the gcov data generator * Add a simple matrix build * Fix older ubuntu versions of gcovr that do not support the '--html-title' option * Ensure we use gcover options that are identical on older ubuntu * Improve coverage generation and required build packages
2021-09-27 11:41:06 +02:00
run: |
sudo apt-get update
sudo apt-get install build-essential
- name: generate a makefile and use it to install more packages
run: |
./autogen.sh
./configure
make build-dep
shell: bash
- name: Run the real configure step
added mingw test platform (#829) * Provide a minimal reimplementation of our autoconf, to try windows builds * Try building with windows * Fix thinko in spelling * Ensure shell script runs inside a shell * Add a hack to aid include discovery * Just keep adding tech debt... * Assume that we will have slashes in some of the replacement strings and avoid that char with sed * Restore one slash * Hack around the tools makefile interdependancy bug * A correct cflags include hack for each compile dir * Ensure we link against winsock (note, even though this says 32bit, it should link the 64bit library ... I think) * Bad link ordering if we dont use LDLIBS * Remove unused make variable * Remove makefile duplication using inheritance (this does mean you can no longer cd tools; make, but must do make tools) * Add missing library for win32 * Show OS variable * Make hack autoconf more robust for tests on non gitlab runners * Remove no longer used substitutions from hack autoconf * Add missing include path to tools under win32 * Build the win32 subdir when the compiler is Msys * The different subdirs have different dependancies * Ensure we can find the include files * Fix library link ordering * Ensure the tools dir can find the special win32 lib * Deal with the differing basic type sizes on both linux/64bit and windows/64bit * Document the steps to mimic the github windows/mingw build locally - to allow for simpler debugging * Ensure branch name in instructions matches my test branch name * Clarify the shell needed to build with mingw * Since the makefile depends on knowing the OS, raise a fatal error if we cannot determine this * Handling different compile environments is hard. - Linux: sane and reasonable results for both uname -s (=Linux) and uname -o (=GNU/Linux) - Windows/Mingw: insane results for uname -s (=MSYS_NT-$MAJOR.$MINOR-$BUILDNR) but sane results for uname -o (Msys) - Macos: sane results for uname -s (=Darwin) but does not support uname -o at all * Revamp the way that Mingw is detected * Avoid attempting to generate gcovr report when running under windows * Whoops, isolate the right step * Fix spelling mistake * win32/Makefile: Remove unused setting and add comment * ensure that all win32 includes use the same expected path * Allow simpler cross compilation by letting configure pass the CC and AR environment through * Avoid multiple '_CRT_SECURE_NO_WARNINGS redefined' warnings * Convert to a consolidated CONFIG_TARGET variable to select any different compile options * Use the more generic printf defines to avoid warnings on mingw * Update mingw build docs * English better for reader happy make * Address a number of mingw compiler warnings * Fix Visual C compile * Be sure to document some of the hacky nature of the mingw build
2021-10-05 21:07:15 +02:00
run: |
CFLAGS="-fprofile-arcs -ftest-coverage" LDFLAGS="--coverage" ./configure --with-zstd
shell: bash
- name: Run embedded tests
run: make test
shell: bash
- if: ${{ always() }}
name: Move test outputs to an arch specific location
shell: bash
run: |
mkdir -p tests/${{ matrix.os }}
mv tests/*.out tests/${{ matrix.os }}
- if: ${{ always() }}
name: Upload tests output
uses: actions/upload-artifact@v2
with:
name: tests-out
path: tests
- name: Generate coverage reports
run: |
make gcov
make cover COVERAGEDIR=coverage/${{ matrix.os }}
added mingw test platform (#829) * Provide a minimal reimplementation of our autoconf, to try windows builds * Try building with windows * Fix thinko in spelling * Ensure shell script runs inside a shell * Add a hack to aid include discovery * Just keep adding tech debt... * Assume that we will have slashes in some of the replacement strings and avoid that char with sed * Restore one slash * Hack around the tools makefile interdependancy bug * A correct cflags include hack for each compile dir * Ensure we link against winsock (note, even though this says 32bit, it should link the 64bit library ... I think) * Bad link ordering if we dont use LDLIBS * Remove unused make variable * Remove makefile duplication using inheritance (this does mean you can no longer cd tools; make, but must do make tools) * Add missing library for win32 * Show OS variable * Make hack autoconf more robust for tests on non gitlab runners * Remove no longer used substitutions from hack autoconf * Add missing include path to tools under win32 * Build the win32 subdir when the compiler is Msys * The different subdirs have different dependancies * Ensure we can find the include files * Fix library link ordering * Ensure the tools dir can find the special win32 lib * Deal with the differing basic type sizes on both linux/64bit and windows/64bit * Document the steps to mimic the github windows/mingw build locally - to allow for simpler debugging * Ensure branch name in instructions matches my test branch name * Clarify the shell needed to build with mingw * Since the makefile depends on knowing the OS, raise a fatal error if we cannot determine this * Handling different compile environments is hard. - Linux: sane and reasonable results for both uname -s (=Linux) and uname -o (=GNU/Linux) - Windows/Mingw: insane results for uname -s (=MSYS_NT-$MAJOR.$MINOR-$BUILDNR) but sane results for uname -o (Msys) - Macos: sane results for uname -s (=Darwin) but does not support uname -o at all * Revamp the way that Mingw is detected * Avoid attempting to generate gcovr report when running under windows * Whoops, isolate the right step * Fix spelling mistake * win32/Makefile: Remove unused setting and add comment * ensure that all win32 includes use the same expected path * Allow simpler cross compilation by letting configure pass the CC and AR environment through * Avoid multiple '_CRT_SECURE_NO_WARNINGS redefined' warnings * Convert to a consolidated CONFIG_TARGET variable to select any different compile options * Use the more generic printf defines to avoid warnings on mingw * Update mingw build docs * English better for reader happy make * Address a number of mingw compiler warnings * Fix Visual C compile * Be sure to document some of the hacky nature of the mingw build
2021-10-05 21:07:15 +02:00
shell: bash
- name: Upload gcovr report artifact
uses: actions/upload-artifact@v2
with:
name: coverage
path: coverage
- name: Upload data to codecov
uses: codecov/codecov-action@v2
test_macos:
needs: smoketest
name: Test MacOS
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os:
- macos-10.15
- macos-11
steps:
- uses: actions/checkout@v2
- name: Install packages
run: |
brew install automake
added test framework and code coverage reporting (#797) * Add a simple test framework * Add a code coverage report example oneliner * Move the coverage report into a separate directory * Add a github action to run tests and publish a branch with the coverage report * Fix: Missing job separator * Fix: remember to actually run configure * Fix: Gotta autogen before I configure * Dont try to upload coverage report unless this is a push * Clearly show the git ref tested in the coverage report * Add a test for the various transforms * Add tests for the elliptic curve and pearson hash * Ensure we ignore new generated output * Remove unneeded boilerplate from the compression tests * Add an example of a test of the encoded wire packets * Ensure that correctly testable data is output even when zstd is not compiled * Factor test runner out into its own script and attempt to add it to the cmake file * Tell cmake about a new object file * Stop trying to make Cmake work... * Stop trying to make cmake work, round 2 * In the middle of a thousand lines of cmake output was one important one - windows could not find assert() - try again * Try again to plumb the tests into cmake * Add missing library to our superset install line * Fix build error when libcap-dev is installed * Switch to using artifact uploads instead of pages to store/show the coverage report * Fix artifact upload yaml * Upload coverage report to codecov * Fix codecov - clearly it doesnt do a recursive search for coverage files * Fix codecov - my hopeful use of a list of directories didnt work * Fix codecov - unfortunately, it doesnt just consume the coverage data and needs us to generate the gcov output * Fix codecov - nope, it still doesnt recursively search * Fix codecov - it really helps if I run the gcov data generator * Add a simple matrix build * Fix older ubuntu versions of gcovr that do not support the '--html-title' option * Ensure we use gcover options that are identical on older ubuntu * Improve coverage generation and required build packages
2021-09-27 11:41:06 +02:00
- name: generate a makefile and use it to install more packages
run: |
./autogen.sh
./configure
make build-dep
shell: bash
added test framework and code coverage reporting (#797) * Add a simple test framework * Add a code coverage report example oneliner * Move the coverage report into a separate directory * Add a github action to run tests and publish a branch with the coverage report * Fix: Missing job separator * Fix: remember to actually run configure * Fix: Gotta autogen before I configure * Dont try to upload coverage report unless this is a push * Clearly show the git ref tested in the coverage report * Add a test for the various transforms * Add tests for the elliptic curve and pearson hash * Ensure we ignore new generated output * Remove unneeded boilerplate from the compression tests * Add an example of a test of the encoded wire packets * Ensure that correctly testable data is output even when zstd is not compiled * Factor test runner out into its own script and attempt to add it to the cmake file * Tell cmake about a new object file * Stop trying to make Cmake work... * Stop trying to make cmake work, round 2 * In the middle of a thousand lines of cmake output was one important one - windows could not find assert() - try again * Try again to plumb the tests into cmake * Add missing library to our superset install line * Fix build error when libcap-dev is installed * Switch to using artifact uploads instead of pages to store/show the coverage report * Fix artifact upload yaml * Upload coverage report to codecov * Fix codecov - clearly it doesnt do a recursive search for coverage files * Fix codecov - my hopeful use of a list of directories didnt work * Fix codecov - unfortunately, it doesnt just consume the coverage data and needs us to generate the gcov output * Fix codecov - nope, it still doesnt recursively search * Fix codecov - it really helps if I run the gcov data generator * Add a simple matrix build * Fix older ubuntu versions of gcovr that do not support the '--html-title' option * Ensure we use gcover options that are identical on older ubuntu * Improve coverage generation and required build packages
2021-09-27 11:41:06 +02:00
- name: Run the real configure step
run: |
CFLAGS="-fprofile-arcs -ftest-coverage" LDFLAGS="--coverage" ./configure --with-zstd
shell: bash
added test framework and code coverage reporting (#797) * Add a simple test framework * Add a code coverage report example oneliner * Move the coverage report into a separate directory * Add a github action to run tests and publish a branch with the coverage report * Fix: Missing job separator * Fix: remember to actually run configure * Fix: Gotta autogen before I configure * Dont try to upload coverage report unless this is a push * Clearly show the git ref tested in the coverage report * Add a test for the various transforms * Add tests for the elliptic curve and pearson hash * Ensure we ignore new generated output * Remove unneeded boilerplate from the compression tests * Add an example of a test of the encoded wire packets * Ensure that correctly testable data is output even when zstd is not compiled * Factor test runner out into its own script and attempt to add it to the cmake file * Tell cmake about a new object file * Stop trying to make Cmake work... * Stop trying to make cmake work, round 2 * In the middle of a thousand lines of cmake output was one important one - windows could not find assert() - try again * Try again to plumb the tests into cmake * Add missing library to our superset install line * Fix build error when libcap-dev is installed * Switch to using artifact uploads instead of pages to store/show the coverage report * Fix artifact upload yaml * Upload coverage report to codecov * Fix codecov - clearly it doesnt do a recursive search for coverage files * Fix codecov - my hopeful use of a list of directories didnt work * Fix codecov - unfortunately, it doesnt just consume the coverage data and needs us to generate the gcov output * Fix codecov - nope, it still doesnt recursively search * Fix codecov - it really helps if I run the gcov data generator * Add a simple matrix build * Fix older ubuntu versions of gcovr that do not support the '--html-title' option * Ensure we use gcover options that are identical on older ubuntu * Improve coverage generation and required build packages
2021-09-27 11:41:06 +02:00
- name: Run embedded tests
run: make test
shell: bash
- if: ${{ always() }}
name: Move test outputs to an arch specific location
shell: bash
run: |
mkdir -p tests/${{ matrix.os }}
mv tests/*.out tests/${{ matrix.os }}
- if: ${{ always() }}
name: Upload tests output
uses: actions/upload-artifact@v2
with:
name: tests-out
path: tests
added test framework and code coverage reporting (#797) * Add a simple test framework * Add a code coverage report example oneliner * Move the coverage report into a separate directory * Add a github action to run tests and publish a branch with the coverage report * Fix: Missing job separator * Fix: remember to actually run configure * Fix: Gotta autogen before I configure * Dont try to upload coverage report unless this is a push * Clearly show the git ref tested in the coverage report * Add a test for the various transforms * Add tests for the elliptic curve and pearson hash * Ensure we ignore new generated output * Remove unneeded boilerplate from the compression tests * Add an example of a test of the encoded wire packets * Ensure that correctly testable data is output even when zstd is not compiled * Factor test runner out into its own script and attempt to add it to the cmake file * Tell cmake about a new object file * Stop trying to make Cmake work... * Stop trying to make cmake work, round 2 * In the middle of a thousand lines of cmake output was one important one - windows could not find assert() - try again * Try again to plumb the tests into cmake * Add missing library to our superset install line * Fix build error when libcap-dev is installed * Switch to using artifact uploads instead of pages to store/show the coverage report * Fix artifact upload yaml * Upload coverage report to codecov * Fix codecov - clearly it doesnt do a recursive search for coverage files * Fix codecov - my hopeful use of a list of directories didnt work * Fix codecov - unfortunately, it doesnt just consume the coverage data and needs us to generate the gcov output * Fix codecov - nope, it still doesnt recursively search * Fix codecov - it really helps if I run the gcov data generator * Add a simple matrix build * Fix older ubuntu versions of gcovr that do not support the '--html-title' option * Ensure we use gcover options that are identical on older ubuntu * Improve coverage generation and required build packages
2021-09-27 11:41:06 +02:00
- name: Generate coverage reports
added test framework and code coverage reporting (#797) * Add a simple test framework * Add a code coverage report example oneliner * Move the coverage report into a separate directory * Add a github action to run tests and publish a branch with the coverage report * Fix: Missing job separator * Fix: remember to actually run configure * Fix: Gotta autogen before I configure * Dont try to upload coverage report unless this is a push * Clearly show the git ref tested in the coverage report * Add a test for the various transforms * Add tests for the elliptic curve and pearson hash * Ensure we ignore new generated output * Remove unneeded boilerplate from the compression tests * Add an example of a test of the encoded wire packets * Ensure that correctly testable data is output even when zstd is not compiled * Factor test runner out into its own script and attempt to add it to the cmake file * Tell cmake about a new object file * Stop trying to make Cmake work... * Stop trying to make cmake work, round 2 * In the middle of a thousand lines of cmake output was one important one - windows could not find assert() - try again * Try again to plumb the tests into cmake * Add missing library to our superset install line * Fix build error when libcap-dev is installed * Switch to using artifact uploads instead of pages to store/show the coverage report * Fix artifact upload yaml * Upload coverage report to codecov * Fix codecov - clearly it doesnt do a recursive search for coverage files * Fix codecov - my hopeful use of a list of directories didnt work * Fix codecov - unfortunately, it doesnt just consume the coverage data and needs us to generate the gcov output * Fix codecov - nope, it still doesnt recursively search * Fix codecov - it really helps if I run the gcov data generator * Add a simple matrix build * Fix older ubuntu versions of gcovr that do not support the '--html-title' option * Ensure we use gcover options that are identical on older ubuntu * Improve coverage generation and required build packages
2021-09-27 11:41:06 +02:00
run: |
make gcov
JSON Reply Management API - feature parity with old management interfaces (#861) * Ensure that recent code additions pass the linter * Include some of the more obviously correct lint fixes to edge_utils.c * Refactor edge JSON api into its own source file * Use shorter names for static management functions * Implement a JSON RPC way of managing the verbosity * Tidy up help display in n2nctl script * Make note of issue with implementing the stop command * Implement a JSON RPC call to fetch current community * Make n2nhttpd time value be more self-contained * Make n2nhttpd order more closely match the existing management stats output * Wire up status page to the verbosity setting * Add JSON versions of the remainder of the edge management stats * Add new file to cmake * Properly define management handler * Only update the last updated timestamp after a successful data fetch * Function and types definition cleanup * Force correct type for python scripts mgmt port * Implement initial JSON API for supernode * Fix whitespace error * Use helper function for rendering peers ip4 address * Proxy the auth requirement back out to the http client, allowing normal http auth to be used * Ensure that we do not leak the federation community * Use the same rpc method name and output for both edge and supernode for peers/edges * Allow n2nctl to show raw data returned without resorting to tricks * Make n2nctl pretty printer understandable with an empty table * Use the full name for supernodes RPC call * Use same RPC method name (but some missing fields) for getting communities from both edge and supernode * Add *_sup_broadcast stats to edge packet stats output * Refacter the stats into a packetstats method for supernode RPC * Even if I am not going to prettyprint the timestamps, at least make all the timestamps on the page the same unit * Simplify the RPC handlers by flagging some as writable and checking that in the multiplexer * Remove invalid edges data * Avoid crash on bad data to verbose RPC * Avoid showing bad or inconsistant protocol data in communities RPC * Minor clarification on when --write is handled * Make linter happy * Fix changed method name in n2nhttpd * Move mainloop stop flag into the n2n_edge_t structure, allowing access from management commands * Implement edge RPC stop command * Move mainloop stop flag into the n2n_sn_t structure, allowing access from management commands * Implement supernode RPC stop command * Allow multiple pages to be served from mini httpd * Extract common script functions into a separate URL * Handle an edge case in the python rpc class With a proper tag-based demultiplexer, this case should be a nop, but we are single-threaded and rely on the packet ordering in this library. * Add n2nhttpd support to query supernode using urls prefixed with /supernode/ * Handle missing values in javascript table print * Add another less filtering javascript key/value renderer * Add a supernode.html page to the n2nhttpd * Address lint issue * Mention the second html page on the Scripts doc * Remove purgable column from supernode edges list - it looks like it is rarely going to be set * Add a simple one-line example command at the top of the API documentation * Acknowledge that this is not the most efficient protocol, but point out that it was not supposed to be * Make it clear that the n2nctl script works for both edge and supernode * Fight with inconsistant github runner results * Turn off the /right/ coverage generator
2021-10-23 07:20:05 +02:00
# This was working fine for tens of jobs, up until 2021-10-19T18:53+0100
# and it still works fine when run from my personal github actions.
# The next run at 2021-10-19T19:08+0100 didnt work.
# Assume that they changed something on the runner - I cannot debug it
# as I do not have a Mac.
#
# make cover COVERAGEDIR=coverage/${{ matrix.os }}
added mingw test platform (#829) * Provide a minimal reimplementation of our autoconf, to try windows builds * Try building with windows * Fix thinko in spelling * Ensure shell script runs inside a shell * Add a hack to aid include discovery * Just keep adding tech debt... * Assume that we will have slashes in some of the replacement strings and avoid that char with sed * Restore one slash * Hack around the tools makefile interdependancy bug * A correct cflags include hack for each compile dir * Ensure we link against winsock (note, even though this says 32bit, it should link the 64bit library ... I think) * Bad link ordering if we dont use LDLIBS * Remove unused make variable * Remove makefile duplication using inheritance (this does mean you can no longer cd tools; make, but must do make tools) * Add missing library for win32 * Show OS variable * Make hack autoconf more robust for tests on non gitlab runners * Remove no longer used substitutions from hack autoconf * Add missing include path to tools under win32 * Build the win32 subdir when the compiler is Msys * The different subdirs have different dependancies * Ensure we can find the include files * Fix library link ordering * Ensure the tools dir can find the special win32 lib * Deal with the differing basic type sizes on both linux/64bit and windows/64bit * Document the steps to mimic the github windows/mingw build locally - to allow for simpler debugging * Ensure branch name in instructions matches my test branch name * Clarify the shell needed to build with mingw * Since the makefile depends on knowing the OS, raise a fatal error if we cannot determine this * Handling different compile environments is hard. - Linux: sane and reasonable results for both uname -s (=Linux) and uname -o (=GNU/Linux) - Windows/Mingw: insane results for uname -s (=MSYS_NT-$MAJOR.$MINOR-$BUILDNR) but sane results for uname -o (Msys) - Macos: sane results for uname -s (=Darwin) but does not support uname -o at all * Revamp the way that Mingw is detected * Avoid attempting to generate gcovr report when running under windows * Whoops, isolate the right step * Fix spelling mistake * win32/Makefile: Remove unused setting and add comment * ensure that all win32 includes use the same expected path * Allow simpler cross compilation by letting configure pass the CC and AR environment through * Avoid multiple '_CRT_SECURE_NO_WARNINGS redefined' warnings * Convert to a consolidated CONFIG_TARGET variable to select any different compile options * Use the more generic printf defines to avoid warnings on mingw * Update mingw build docs * English better for reader happy make * Address a number of mingw compiler warnings * Fix Visual C compile * Be sure to document some of the hacky nature of the mingw build
2021-10-05 21:07:15 +02:00
shell: bash
JSON Reply Management API - feature parity with old management interfaces (#861) * Ensure that recent code additions pass the linter * Include some of the more obviously correct lint fixes to edge_utils.c * Refactor edge JSON api into its own source file * Use shorter names for static management functions * Implement a JSON RPC way of managing the verbosity * Tidy up help display in n2nctl script * Make note of issue with implementing the stop command * Implement a JSON RPC call to fetch current community * Make n2nhttpd time value be more self-contained * Make n2nhttpd order more closely match the existing management stats output * Wire up status page to the verbosity setting * Add JSON versions of the remainder of the edge management stats * Add new file to cmake * Properly define management handler * Only update the last updated timestamp after a successful data fetch * Function and types definition cleanup * Force correct type for python scripts mgmt port * Implement initial JSON API for supernode * Fix whitespace error * Use helper function for rendering peers ip4 address * Proxy the auth requirement back out to the http client, allowing normal http auth to be used * Ensure that we do not leak the federation community * Use the same rpc method name and output for both edge and supernode for peers/edges * Allow n2nctl to show raw data returned without resorting to tricks * Make n2nctl pretty printer understandable with an empty table * Use the full name for supernodes RPC call * Use same RPC method name (but some missing fields) for getting communities from both edge and supernode * Add *_sup_broadcast stats to edge packet stats output * Refacter the stats into a packetstats method for supernode RPC * Even if I am not going to prettyprint the timestamps, at least make all the timestamps on the page the same unit * Simplify the RPC handlers by flagging some as writable and checking that in the multiplexer * Remove invalid edges data * Avoid crash on bad data to verbose RPC * Avoid showing bad or inconsistant protocol data in communities RPC * Minor clarification on when --write is handled * Make linter happy * Fix changed method name in n2nhttpd * Move mainloop stop flag into the n2n_edge_t structure, allowing access from management commands * Implement edge RPC stop command * Move mainloop stop flag into the n2n_sn_t structure, allowing access from management commands * Implement supernode RPC stop command * Allow multiple pages to be served from mini httpd * Extract common script functions into a separate URL * Handle an edge case in the python rpc class With a proper tag-based demultiplexer, this case should be a nop, but we are single-threaded and rely on the packet ordering in this library. * Add n2nhttpd support to query supernode using urls prefixed with /supernode/ * Handle missing values in javascript table print * Add another less filtering javascript key/value renderer * Add a supernode.html page to the n2nhttpd * Address lint issue * Mention the second html page on the Scripts doc * Remove purgable column from supernode edges list - it looks like it is rarely going to be set * Add a simple one-line example command at the top of the API documentation * Acknowledge that this is not the most efficient protocol, but point out that it was not supposed to be * Make it clear that the n2nctl script works for both edge and supernode * Fight with inconsistant github runner results * Turn off the /right/ coverage generator
2021-10-23 07:20:05 +02:00
# - name: Upload gcovr report artifact
# uses: actions/upload-artifact@v2
# with:
# name: coverage
# path: coverage
added test framework and code coverage reporting (#797) * Add a simple test framework * Add a code coverage report example oneliner * Move the coverage report into a separate directory * Add a github action to run tests and publish a branch with the coverage report * Fix: Missing job separator * Fix: remember to actually run configure * Fix: Gotta autogen before I configure * Dont try to upload coverage report unless this is a push * Clearly show the git ref tested in the coverage report * Add a test for the various transforms * Add tests for the elliptic curve and pearson hash * Ensure we ignore new generated output * Remove unneeded boilerplate from the compression tests * Add an example of a test of the encoded wire packets * Ensure that correctly testable data is output even when zstd is not compiled * Factor test runner out into its own script and attempt to add it to the cmake file * Tell cmake about a new object file * Stop trying to make Cmake work... * Stop trying to make cmake work, round 2 * In the middle of a thousand lines of cmake output was one important one - windows could not find assert() - try again * Try again to plumb the tests into cmake * Add missing library to our superset install line * Fix build error when libcap-dev is installed * Switch to using artifact uploads instead of pages to store/show the coverage report * Fix artifact upload yaml * Upload coverage report to codecov * Fix codecov - clearly it doesnt do a recursive search for coverage files * Fix codecov - my hopeful use of a list of directories didnt work * Fix codecov - unfortunately, it doesnt just consume the coverage data and needs us to generate the gcov output * Fix codecov - nope, it still doesnt recursively search * Fix codecov - it really helps if I run the gcov data generator * Add a simple matrix build * Fix older ubuntu versions of gcovr that do not support the '--html-title' option * Ensure we use gcover options that are identical on older ubuntu * Improve coverage generation and required build packages
2021-09-27 11:41:06 +02:00
- name: Upload data to codecov
uses: codecov/codecov-action@v2
test_windows:
needs: smoketest
name: Test Windows
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os:
- windows-2016
- windows-2019
- windows-2022
steps:
- uses: actions/checkout@v2
- name: generate a makefile and use it to install more packages
run: |
# This is a pretty big hammer, but gets the windows compile moving
./scripts/hack_fakeautoconf.sh
make build-dep
shell: bash
- name: Run a configure step
run: |
CFLAGS="-fprofile-arcs -ftest-coverage" LDFLAGS="--coverage" ./scripts/hack_fakeautoconf.sh
shell: bash
- name: Run embedded tests
run: make test
shell: bash
- if: ${{ always() }}
name: Move test outputs to an arch specific location
shell: bash
run: |
mkdir -p tests/${{ matrix.os }}
mv tests/*.out tests/${{ matrix.os }}
- if: ${{ always() }}
name: Upload tests output
uses: actions/upload-artifact@v2
with:
name: tests-out
path: tests
- name: Generate coverage data
run: |
make gcov
shell: bash
- name: Upload data to codecov
uses: codecov/codecov-action@v2
package_dpkg:
name: Package for Debian/Ubuntu
Basic C Code lint checker and shell checker (#859) * Factor build packages out into a more maintainable list * Create a location for scripts to live * Provide a make target to return the source dir as close as reasonable to the original distributed state * Add a code lint step, checking the coding style * Change test harness as recommended by shellcheck * Ensure we actually have the linter tool installed * Use the correct directory for cmake to run the tests * Adjust for the older uncrustify in the current github ubuntu-latest * Make one file pass the linter * Integrate the lint with the existing test workflow * Add files with minimal changes needed to the linter * Add more files with minimal changes needed to the linter * Dont build binaries if we fail the lint test * Update the phony targets with the lint steps * Ensure the flake8 package is installed in the new lint workflow job * Use the makefile to drive the packages needed to install for linting * No need to add dependancies on lint, just rely on the workflow status to show failure * Update the scripts dir README to reflect current assumptions * Rename and briefly document the indent.sh script * Fix the ignore to ignore the right Makefile * Rename the test_harness script to make it clear it is a shell script * Provide a master lint make target and add a shell script lint tool * Elminate stray tabs * Drop include/auth.h from linter - there are inconsistant results with function definitions when using the current uncrustify rules
2021-10-23 21:36:18 +02:00
needs:
- test_linux
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
arch:
- amd64
- arm64
- armhf
- i386
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install packages needed for build
run: |
sudo apt-get install debhelper build-essential crossbuild-essential-${{ matrix.arch }}
- name: Configure
run: |
# This will warn about CC, but we cannot set CC until we run it :-S
HOST_TRIPLET=$(dpkg-architecture -a${{ matrix.arch }} -q DEB_HOST_GNU_TYPE)
export CC=$HOST_TRIPLET-gcc
export AR=$HOST_TRIPLET-ar
./autogen.sh
./configure --host $HOST_TRIPLET
cd packages/debian/
./configure EXTN=${{ matrix.arch }}
- name: Build
run: |
cd packages/debian/
make
- name: Upload dpkg
uses: actions/upload-artifact@v2
with:
name: packages-dpkg
path: packages/debian/*.deb
package_rpm:
name: Package for Redhat/RPM
Basic C Code lint checker and shell checker (#859) * Factor build packages out into a more maintainable list * Create a location for scripts to live * Provide a make target to return the source dir as close as reasonable to the original distributed state * Add a code lint step, checking the coding style * Change test harness as recommended by shellcheck * Ensure we actually have the linter tool installed * Use the correct directory for cmake to run the tests * Adjust for the older uncrustify in the current github ubuntu-latest * Make one file pass the linter * Integrate the lint with the existing test workflow * Add files with minimal changes needed to the linter * Add more files with minimal changes needed to the linter * Dont build binaries if we fail the lint test * Update the phony targets with the lint steps * Ensure the flake8 package is installed in the new lint workflow job * Use the makefile to drive the packages needed to install for linting * No need to add dependancies on lint, just rely on the workflow status to show failure * Update the scripts dir README to reflect current assumptions * Rename and briefly document the indent.sh script * Fix the ignore to ignore the right Makefile * Rename the test_harness script to make it clear it is a shell script * Provide a master lint make target and add a shell script lint tool * Elminate stray tabs * Drop include/auth.h from linter - there are inconsistant results with function definitions when using the current uncrustify rules
2021-10-23 21:36:18 +02:00
needs:
- test_linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install packages needed for build
run: |
sudo apt-get install rpm
- name: Configure
run: |
./autogen.sh
./configure
cd packages/rpm/
./configure
- name: Build
run: |
make
HOME=$(pwd)/../
cd packages/rpm/
make
cd ../../
mv ../rpmbuild ./
- name: Upload rpm
uses: actions/upload-artifact@v2
with:
name: packages-rpm
path: rpmbuild/RPMS/x86_64/*.rpm
binaries_windows:
name: Binaries for Windows (x86_64-pc-mingw64)
Basic C Code lint checker and shell checker (#859) * Factor build packages out into a more maintainable list * Create a location for scripts to live * Provide a make target to return the source dir as close as reasonable to the original distributed state * Add a code lint step, checking the coding style * Change test harness as recommended by shellcheck * Ensure we actually have the linter tool installed * Use the correct directory for cmake to run the tests * Adjust for the older uncrustify in the current github ubuntu-latest * Make one file pass the linter * Integrate the lint with the existing test workflow * Add files with minimal changes needed to the linter * Add more files with minimal changes needed to the linter * Dont build binaries if we fail the lint test * Update the phony targets with the lint steps * Ensure the flake8 package is installed in the new lint workflow job * Use the makefile to drive the packages needed to install for linting * No need to add dependancies on lint, just rely on the workflow status to show failure * Update the scripts dir README to reflect current assumptions * Rename and briefly document the indent.sh script * Fix the ignore to ignore the right Makefile * Rename the test_harness script to make it clear it is a shell script * Provide a master lint make target and add a shell script lint tool * Elminate stray tabs * Drop include/auth.h from linter - there are inconsistant results with function definitions when using the current uncrustify rules
2021-10-23 21:36:18 +02:00
needs:
- test_windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Configure and Build
shell: bash
run: |
./scripts/hack_fakeautoconf.sh
make
- name: Create binary dir
shell: bash
run: |
make install DESTDIR=binaries/x86_64-pc-mingw64
- name: Upload binary artifacts
uses: actions/upload-artifact@v2
with:
name: binaries
path: binaries
binaries_macos:
name: Binaries for MacOS (x86_64-apple-darwin)
Basic C Code lint checker and shell checker (#859) * Factor build packages out into a more maintainable list * Create a location for scripts to live * Provide a make target to return the source dir as close as reasonable to the original distributed state * Add a code lint step, checking the coding style * Change test harness as recommended by shellcheck * Ensure we actually have the linter tool installed * Use the correct directory for cmake to run the tests * Adjust for the older uncrustify in the current github ubuntu-latest * Make one file pass the linter * Integrate the lint with the existing test workflow * Add files with minimal changes needed to the linter * Add more files with minimal changes needed to the linter * Dont build binaries if we fail the lint test * Update the phony targets with the lint steps * Ensure the flake8 package is installed in the new lint workflow job * Use the makefile to drive the packages needed to install for linting * No need to add dependancies on lint, just rely on the workflow status to show failure * Update the scripts dir README to reflect current assumptions * Rename and briefly document the indent.sh script * Fix the ignore to ignore the right Makefile * Rename the test_harness script to make it clear it is a shell script * Provide a master lint make target and add a shell script lint tool * Elminate stray tabs * Drop include/auth.h from linter - there are inconsistant results with function definitions when using the current uncrustify rules
2021-10-23 21:36:18 +02:00
needs:
- test_macos
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Install packages needed for build
run: |
brew install automake
- name: Configure and Build
shell: bash
run: |
./autogen.sh
./configure
make
- name: Create binary dir
shell: bash
run: |
make install DESTDIR=binaries/x86_64-apple-darwin
- name: Upload binary artifacts
uses: actions/upload-artifact@v2
with:
name: binaries
path: binaries
binaries_linux_crosscompile:
name: Binaries for linux
Basic C Code lint checker and shell checker (#859) * Factor build packages out into a more maintainable list * Create a location for scripts to live * Provide a make target to return the source dir as close as reasonable to the original distributed state * Add a code lint step, checking the coding style * Change test harness as recommended by shellcheck * Ensure we actually have the linter tool installed * Use the correct directory for cmake to run the tests * Adjust for the older uncrustify in the current github ubuntu-latest * Make one file pass the linter * Integrate the lint with the existing test workflow * Add files with minimal changes needed to the linter * Add more files with minimal changes needed to the linter * Dont build binaries if we fail the lint test * Update the phony targets with the lint steps * Ensure the flake8 package is installed in the new lint workflow job * Use the makefile to drive the packages needed to install for linting * No need to add dependancies on lint, just rely on the workflow status to show failure * Update the scripts dir README to reflect current assumptions * Rename and briefly document the indent.sh script * Fix the ignore to ignore the right Makefile * Rename the test_harness script to make it clear it is a shell script * Provide a master lint make target and add a shell script lint tool * Elminate stray tabs * Drop include/auth.h from linter - there are inconsistant results with function definitions when using the current uncrustify rules
2021-10-23 21:36:18 +02:00
needs:
- test_linux
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
arch:
- arm-linux-gnueabi
# I assume these architectures produce working code, but this has
# not been directly confirmed.
# They are compiled dynamically against normal libc, so will not
# work on openwrt.
- aarch64-linux-gnu
- mips-linux-gnu
- mipsel-linux-gnu
steps:
- uses: actions/checkout@v2
- name: Install cross compiler
run: |
sudo apt-get install binutils-${{ matrix.arch }} gcc-${{ matrix.arch }}
- name: Configure and Build
shell: bash
run: |
./autogen.sh
export CC=${{ matrix.arch }}-gcc
export AR=${{ matrix.arch }}-ar
./configure --host ${{ matrix.arch }}
make
- name: Create binary dir
shell: bash
run: |
make install DESTDIR=binaries/${{ matrix.arch }}
- name: Upload binary artifacts
uses: actions/upload-artifact@v2
with:
name: binaries
path: binaries