From 2b705ba17aa0f2544d22b2bb7d8ed59189796a64 Mon Sep 17 00:00:00 2001 From: Ashton Snelgrove Date: Wed, 13 Jan 2021 16:38:13 -0700 Subject: [PATCH] Add building a regression test image on master. --- .github/workflows/build.yml | 21 +++++++++++++---- .github/workflows/regression.yml | 39 ++++++++++++++++++++++++++++++++ docker/Dockerfile.regression | 5 ++++ 3 files changed, 61 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/regression.yml create mode 100644 docker/Dockerfile.regression diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bb93d63b3..182b79df7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,11 +1,16 @@ name: linux_build # Run CI on -# - each push -# - each pull request -# - scheduled weekly +# - each push if no code has changed on: push: + paths: + - '**.c' + - '**.cc' + - '**.c\+\+' + - '**.cpp' + - '**.h' + - '**.hh' pull_request: schedule: - cron: '0 0 * * 0 ' # weekly @@ -137,6 +142,7 @@ jobs: yosys/yosys-smtbmc docker_distribution: name: Build docker image for distribution + if: ${{ github.ref == 'refs/heads/master'}} runs-on: ubuntu-latest needs: linux_build steps: @@ -156,13 +162,20 @@ jobs: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.CR_PAT }} - - name: Build and push + - name: Build and push runtime image uses: docker/build-push-action@v2 with: context: . file: ./docker/Dockerfile.run push: true tags: ghcr.io/lnis-uofu/openfpga-run:latest + - name: Build and push test image + uses: docker/build-push-action@v2 + with: + context: . + file: ./docker/Dockerfile.test + push: true + tags: ghcr.io/lnis-uofu/openfpga-regression-tests:latest regression_tests: name: Regression tests runs-on: ubuntu-18.04 diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml new file mode 100644 index 000000000..5386463d2 --- /dev/null +++ b/.github/workflows/regression.yml @@ -0,0 +1,39 @@ +name: regression_tests + +# Run regressions on each push if no code has changed +on: + push: + paths-ignore: + - '**.c' + - '**.cc' + - '**.c\+\+' + - '**.cpp' + - '**.h' + - '**.hh' + +# Multiple job to tests +jobs: + regression_tests: + name: Regression tests + runs-on: ubuntu-18.04 + container: ghcr.io/lnis-uofu/openfpga-regression-tests:latest + strategy: + fail-fast: false + matrix: + config: + - name: "Basic Regression Tests: GCC-8 (Ubuntu 18.04)" + script: basic_reg_test.sh + - name: "FPGA-Verilog Regression Tests: GCC-8 (Ubuntu 18.04)" + script: fpga_verilog_reg_test.sh + - name: "FPGA-Bitstream Regression Tests: GCC-8 (Ubuntu 18.04)" + script: fpga_bitstream_reg_test.sh + - name: "FPGA-SDC Regression Tests: GCC-8 (Ubuntu 18.04)" + script: fpga_sdc_reg_test.sh + - name: "FPGA-SPICE Regression Tests: GCC-8 (Ubuntu 18.04)" + script: fpga_spice_reg_test.sh + steps: + - name: Checkout OpenFPGA repo + uses: actions/checkout@v2 + - name: ${{matrix.config.name}} + shell: bash + run: source .github/workflows/${{matrix.config.script}} diff --git a/docker/Dockerfile.regression b/docker/Dockerfile.regression new file mode 100644 index 000000000..25ba2cbbd --- /dev/null +++ b/docker/Dockerfile.regression @@ -0,0 +1,5 @@ +FROM ghcr.io/lnis-uofu/openfpga-buildenv-test:latest +RUN mkdir /opt/openfpga +COPY abc/abc ace2/ace openfpga/openfpga vpr/vpr yosys/yosys yosys/yosys-abc yosys/yosys-config yosys/yosys-filterlib yosys/yosys-smtbmc /opt/openfpga/ +RUN cd /opt/openfpga && chmod +x abc ace openfpga vpr yosys yosys-abc yosys-config yosys-filterlib yosys-smtbmc +ENV PATH="/opt/openfpga:${PATH}"