From 37619d21ab27ccdee34780a6be6514326348a120 Mon Sep 17 00:00:00 2001 From: umarcor Date: Wed, 13 Jan 2021 23:09:01 +0100 Subject: [PATCH] ci: add GitHub Actions workflow 'Test' --- .github/generate_matrix.sh | 8 +++++++ .github/workflows/Test.yml | 45 ++++++++++++++++++++++++++++++++++++++ Makefile | 2 +- README.md | 2 ++ tests.txt | 10 ++++----- 5 files changed, 61 insertions(+), 6 deletions(-) create mode 100755 .github/generate_matrix.sh create mode 100644 .github/workflows/Test.yml diff --git a/.github/generate_matrix.sh b/.github/generate_matrix.sh new file mode 100755 index 0000000..9ca7957 --- /dev/null +++ b/.github/generate_matrix.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +_matrix='' +for item in $(cat tests.txt); do + _matrix+="'$item', " +done + +echo "::set-output name=matrix::[$_matrix]" diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml new file mode 100644 index 0000000..5780f19 --- /dev/null +++ b/.github/workflows/Test.yml @@ -0,0 +1,45 @@ +name: Test + +on: + push: + pull_request: + +jobs: + + + Matrix: + runs-on: ubuntu-latest + name: '🧾 Generate Test matrix' + outputs: + matrix: ${{ steps.generate.outputs.matrix }} + steps: + + - name: '🧰 Checkout' + uses: actions/checkout@v2 + + - id: generate + name: '🧾 generate_matrix.sh' + run: ./.github/generate_matrix.sh + + + Test: + needs: Matrix + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + design: ${{ fromJson(needs.Matrix.outputs.matrix) }} + name: '🛳️ Test · ${{ matrix.design }}' + steps: + + - name: '🧰 Checkout' + uses: actions/checkout@v1 + with: + submodules: recursive + + - name: '🛳️ Execute make ${{ matrix.design }} in hdlc/formal:all' + uses: docker://hdlc/formal:all + with: + args: make ${{ matrix.design }} + env: + BUILD_NAME: ACCEPTANCE diff --git a/Makefile b/Makefile index 72f938d..f886291 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -DESIGNS := $(file < tests.txt) +DESIGNS := $(shell cat tests.txt) .PHONY: ${DESIGNS} all clean diff --git a/README.md b/README.md index c4f30a8..c3720a3 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![](https://img.shields.io/github/workflow/status/tmeissner/formal_hw_verification/Test/main?longCache=true&style=flat-square&label=Test&logo=GitHub%20Actions&logoColor=fff)](https://github.com/tmeissner/formal_hw_verification/actions?query=workflow%3ATest) + The original repository is located on my own git-server at [https://git.goodcleanfun.de/tmeissner/formal_hw_verification](https://git.goodcleanfun.de/tmeissner/formal_hw_verification) It is mirrored to github with every push, so both should be in sync. diff --git a/tests.txt b/tests.txt index f0d711b..14b17e3 100644 --- a/tests.txt +++ b/tests.txt @@ -1,5 +1,5 @@ -alu \ -counter \ -fifo \ -vai_fifo \ -vai_reg +alu +counter +fifo +vai_fifo +vai_reg \ No newline at end of file