From d2f836bb44fb5e982a24042fa8034a5f46e7095c Mon Sep 17 00:00:00 2001 From: "Archie L. Cobbs" Date: Wed, 7 Jun 2023 16:46:52 -0500 Subject: [PATCH] Add github CI workflow (from PR #7). Contributed by Aleksa Sarai. --- .github/workflows/test.yml | 60 ++++++++++++++++++++++++++++++++++++++ Makefile.am | 6 ++-- 2 files changed, 63 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..4045733 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,60 @@ +name: ci +on: + push: + tags: + - v* + branches: + - master + pull_request: + schedule: + - cron: '30 6 * * 1' +permissions: + contents: read + +jobs: + test: + strategy: + fail-fast: false + matrix: + # The set of compilers provided in each Ubuntu version comes from: + # + os: [ubuntu-22.04] + cc: [gcc-9, gcc-10, gcc-11, gcc-12, clang-11, clang-12, clang-13, clang-14] + include: + # Latest gcc and clang versions in Ubuntu. + - os: ubuntu-latest + cc: gcc + - os: ubuntu-latest + cc: clang + # Ubuntu 20.04 -- GCC 7..8 and clang 7..10. + # TODO: Find a nicer way to do this... + - os: ubuntu-20.04 + cc: gcc-7 + - os: ubuntu-20.04 + cc: gcc-8 + - os: ubuntu-20.04 + cc: clang-7 + - os: ubuntu-20.04 + cc: clang-8 + - os: ubuntu-20.04 + cc: clang-9 + - os: ubuntu-20.04 + cc: clang-10 + name: make check (${{matrix.os}}, ${{ matrix.cc }}) + runs-on: ${{ matrix.os }} + env: + CC: ${{ matrix.cc }} + steps: + - name: checkout + uses: actions/checkout@v3 + - name: install ${{ matrix.cc }} + run: | + sudo apt-get update + sudo apt-get install ${{ matrix.cc }} + - name: autoconf + run: ./autogen.sh && ./configure + - name: make + run: make + - name: make check + run: make check + diff --git a/Makefile.am b/Makefile.am index f29608f..d44db07 100644 --- a/Makefile.am +++ b/Makefile.am @@ -23,9 +23,9 @@ EXTRA_libnbcompat_la_DEPENDENCIES: $(LTLIBOBJS) # Test programs. TESTS = rmd160-test sha1-test sha2-test check_PROGRAMS = rmd160-test sha1-test sha2-test -rmd160_test_LDADD = .libs/libnbcompat.a -sha1_test_LDADD = .libs/libnbcompat.a -sha2_test_LDADD = .libs/libnbcompat.a +rmd160_test_LDADD = .libs/libnbcompat.la +sha1_test_LDADD = .libs/libnbcompat.la +sha2_test_LDADD = .libs/libnbcompat.la # It's bad form to install your "config.h", so we tweak it to make it less harmful install-data-hook: