Skip to content

Commit

Permalink
Temp
Browse files Browse the repository at this point in the history
  • Loading branch information
DigitalBrains1 committed Mar 26, 2023
1 parent 5389ecc commit 1669ed0
Show file tree
Hide file tree
Showing 3 changed files with 176 additions and 166 deletions.
211 changes: 108 additions & 103 deletions .ci/gitlab/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,108 +68,113 @@ build:

# Tests run on shared runners:

cores:unittests:
extends: .test-nocache
script:
- ./dist-newstyle/build/*/*/clash-cores-*/t/unittests/build/unittests/unittests --hide-successes

cosim:unittests:
extends: .test-nocache
script:
- ./dist-newstyle/build/*/*/clash-cosim-*/build/test/test

prelude:unittests:
extends: .test-nocache
script:
- ./dist-newstyle/build/*/*/clash-prelude-*/t/unittests/build/unittests/unittests --hide-successes

lib:doctests:
extends: .test-nocache
script:
- ./dist-newstyle/build/*/*/clash-lib-*/t/doctests/build/doctests/doctests -j${THREADS}

lib:unittests:
extends: .test-nocache
script:
- ./dist-newstyle/build/*/*/clash-lib-*/t/unittests/build/unittests/unittests --hide-successes

prelude:doctests:
extends: .test-nocache
script:
- .ci/retry-ghc-heisenbug/script -v ./dist-newstyle/build/*/*/clash-prelude-*/t/doctests/build/doctests/doctests -j${THREADS}

# Tests run on local fast machines:

# Normally, this job is small. But it is flaky on GHC 9.2; it sometimes fails
# and we don't know yet why. When it fails, it recompiles things it should have
# picked up from the 'build' issue and then it is a larger job, so we keep it on
# local runners for now.
build-clash-dev:
extends: .test-cache-local
script:
- .ci/build_clash_dev.sh

suite:vhdl:
extends: .test-cache-local
script:
- ./dist-newstyle/build/*/*/clash-testsuite-*/x/clash-testsuite/build/clash-testsuite/clash-testsuite -j$THREADS -p .VHDL --hide-successes --no-vivado

suite:verilog:
#cores:unittests:
# extends: .test-nocache
# script:
# - ./dist-newstyle/build/*/*/clash-cores-*/t/unittests/build/unittests/unittests --hide-successes
#
#cosim:unittests:
# extends: .test-nocache
# script:
# - ./dist-newstyle/build/*/*/clash-cosim-*/build/test/test
#
#prelude:unittests:
# extends: .test-nocache
# script:
# - ./dist-newstyle/build/*/*/clash-prelude-*/t/unittests/build/unittests/unittests --hide-successes
#
#lib:doctests:
# extends: .test-nocache
# script:
# - ./dist-newstyle/build/*/*/clash-lib-*/t/doctests/build/doctests/doctests -j${THREADS}
#
#lib:unittests:
# extends: .test-nocache
# script:
# - ./dist-newstyle/build/*/*/clash-lib-*/t/unittests/build/unittests/unittests --hide-successes
#
#prelude:doctests:
# extends: .test-nocache
# script:
# - .ci/retry-ghc-heisenbug/script -v ./dist-newstyle/build/*/*/clash-prelude-*/t/doctests/build/doctests/doctests -j${THREADS}
#
## Tests run on local fast machines:
#
## Normally, this job is small. But it is flaky on GHC 9.2; it sometimes fails
## and we don't know yet why. When it fails, it recompiles things it should have
## picked up from the 'build' issue and then it is a larger job, so we keep it on
## local runners for now.
#build-clash-dev:
# extends: .test-cache-local
# script:
# - .ci/build_clash_dev.sh
#
#suite:vhdl:
# extends: .test-cache-local
# script:
# - ./dist-newstyle/build/*/*/clash-testsuite-*/x/clash-testsuite/build/clash-testsuite/clash-testsuite -j$THREADS -p .VHDL --hide-successes --no-vivado

suite:tests-lib:
extends: .test-cache-local
script:
- ./dist-newstyle/build/*/*/clash-testsuite-*/x/clash-testsuite/build/clash-testsuite/clash-testsuite -j$THREADS -p .Verilog --hide-successes --no-vivado

suite:systemverilog:
extends: .test-cache-local
script:
- ./dist-newstyle/build/*/*/clash-testsuite-*/x/clash-testsuite/build/clash-testsuite/clash-testsuite -j$THREADS -p .SystemVerilog --hide-successes --no-modelsim --no-vivado

# Vivado is quite slow, so we only run a subset of the tests on development branches
# with it. The full testsuite gets run with Vivado every night on 'master'.
suite:cores:
extends: .test-cache-local
script:
- source /opt/tools/Xilinx/Vivado/2022.1/settings64.sh
- ./dist-newstyle/build/*/*/clash-testsuite-*/x/clash-testsuite/build/clash-testsuite/clash-testsuite -j$THREADS -p Cores --hide-successes --no-modelsim --no-ghdl --no-iverilog --no-verilator --no-symbiyosys
tags:
- local
- vivado-2022.1-standard

ffi:interface-tests:
extends: .test-cache-local
script:
- ./dist-newstyle/build/*/*/clash-ffi-*/x/ffi-interface-tests/build/ffi-interface-tests/ffi-interface-tests --smallcheck-max-count 2000

ffi:example:
extends: .test-cache-local
script:
- cabal build clash # ensure clash has been built (avoids some legacy cabal issue)
- cd clash-ffi/example && ./run-iverilog.sh


# Tests run on local fast machines with Vivado installed. We only run these at night
# to save resources - as Vivado is quite slow to execute.
.test-cache-local-nightly:
extends: .test-cache-local
rules:
- if: $CI_PIPELINE_SOURCE == "schedule" # When schedueled (at night)
- if: $CI_PIPELINE_SOURCE == "trigger" # When triggered (manual triggers)
- if: '$CI_COMMIT_TAG != null' # When tags are set (releases)

suite:vivado:vhdl:
extends: .test-cache-local-nightly
script:
- source /opt/tools/Xilinx/Vivado/2022.1/settings64.sh
- ./dist-newstyle/build/*/*/clash-testsuite-*/x/clash-testsuite/build/clash-testsuite/clash-testsuite -j$THREADS -p .VHDL --hide-successes --no-modelsim --no-ghdl --no-iverilog --no-verilator --no-symbiyosys
tags:
- local
- vivado-2022.1-standard

suite:vivado:verilog:
extends: .test-cache-local-nightly
script:
- source /opt/tools/Xilinx/Vivado/2022.1/settings64.sh
- ./dist-newstyle/build/*/*/clash-testsuite-*/x/clash-testsuite/build/clash-testsuite/clash-testsuite -j$THREADS -p .Verilog --hide-successes --no-modelsim --no-ghdl --no-iverilog --no-verilator --no-symbiyosys
tags:
- local
- vivado-2022.1-standard
- ./dist-newstyle/build/*/*/clash-testsuite-*/x/clash-testsuite/build/clash-testsuite/clash-testsuite -j$THREADS -p '/[clash-lib test]/'

#suite:verilog:
# extends: .test-cache-local
# script:
# - ./dist-newstyle/build/*/*/clash-testsuite-*/x/clash-testsuite/build/clash-testsuite/clash-testsuite -j$THREADS -p .Verilog --hide-successes --no-vivado
#
#suite:systemverilog:
# extends: .test-cache-local
# script:
# - ./dist-newstyle/build/*/*/clash-testsuite-*/x/clash-testsuite/build/clash-testsuite/clash-testsuite -j$THREADS -p .SystemVerilog --hide-successes --no-modelsim --no-vivado
#
## Vivado is quite slow, so we only run a subset of the tests on development branches
## with it. The full testsuite gets run with Vivado every night on 'master'.
#suite:cores:
# extends: .test-cache-local
# script:
# - source /opt/tools/Xilinx/Vivado/2022.1/settings64.sh
# - ./dist-newstyle/build/*/*/clash-testsuite-*/x/clash-testsuite/build/clash-testsuite/clash-testsuite -j$THREADS -p Cores --hide-successes --no-modelsim --no-ghdl --no-iverilog --no-verilator --no-symbiyosys
# tags:
# - local
# - vivado-2022.1-standard
#
#ffi:interface-tests:
# extends: .test-cache-local
# script:
# - ./dist-newstyle/build/*/*/clash-ffi-*/x/ffi-interface-tests/build/ffi-interface-tests/ffi-interface-tests --smallcheck-max-count 2000
#
#ffi:example:
# extends: .test-cache-local
# script:
# - cabal build clash # ensure clash has been built (avoids some legacy cabal issue)
# - cd clash-ffi/example && ./run-iverilog.sh
#
#
## Tests run on local fast machines with Vivado installed. We only run these at night
## to save resources - as Vivado is quite slow to execute.
#.test-cache-local-nightly:
# extends: .test-cache-local
# rules:
# - if: $CI_PIPELINE_SOURCE == "schedule" # When schedueled (at night)
# - if: $CI_PIPELINE_SOURCE == "trigger" # When triggered (manual triggers)
# - if: '$CI_COMMIT_TAG != null' # When tags are set (releases)
#
#suite:vivado:vhdl:
# extends: .test-cache-local-nightly
# script:
# - source /opt/tools/Xilinx/Vivado/2022.1/settings64.sh
# - ./dist-newstyle/build/*/*/clash-testsuite-*/x/clash-testsuite/build/clash-testsuite/clash-testsuite -j$THREADS -p .VHDL --hide-successes --no-modelsim --no-ghdl --no-iverilog --no-verilator --no-symbiyosys
# tags:
# - local
# - vivado-2022.1-standard
#
#suite:vivado:verilog:
# extends: .test-cache-local-nightly
# script:
# - source /opt/tools/Xilinx/Vivado/2022.1/settings64.sh
# - ./dist-newstyle/build/*/*/clash-testsuite-*/x/clash-testsuite/build/clash-testsuite/clash-testsuite -j$THREADS -p .Verilog --hide-successes --no-modelsim --no-ghdl --no-iverilog --no-verilator --no-symbiyosys
# tags:
# - local
# - vivado-2022.1-standard
125 changes: 63 additions & 62 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ default:

include:
- '/.ci/gitlab/common.yml'
- '/.ci/gitlab/publish.yml'
# - '/.ci/gitlab/publish.yml'
# - '/.ci/gitlab/benchmark.yml'

variables:
Expand Down Expand Up @@ -32,67 +32,68 @@ tests:
strategy: depend
parallel:
matrix:
- GHC_VERSION: [8.8.4, 8.10.7, 9.0.2, 9.2.5]
- GHC_VERSION: 8.6.5
MULTIPLE_HIDDEN: "no"

stack-build:
extends: .common-local
needs: []
stage: test
variables:
GHC_VERSION: 8.10.7
script:
- .ci/stack_build.sh

nix-build:
image: nixos/nix:2.10.1
needs: []
stage: test
before_script:
- nix-env -i gawk
script:
- nix-build -j$(./.ci/effective_cpus.sh)
tags:
- local

haddock:
extends: .common-local
needs: []
stage: test
variables:
GHC_VERSION: 9.0.2
artifacts:
paths:
- hadocs/*/*
expire_in: 1 month
script:
- .ci/build_docs.sh

# # Run benchmarks for isclashfastyet.com
# benchmark-8.10.2:
# extends: .benchmark

# "Publish" a release candidate
hackage-release-candidate:
extends: .hackage

variables:
HACKAGE_RELEASE: "no"

rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_PIPELINE_SOURCE == "trigger"

# Release new version of Clash to Hackage
hackage-release:
extends: .hackage

variables:
HACKAGE_RELEASE: "yes"

rules:
- if: '$CI_COMMIT_TAG != null' # tags
- GHC_VERSION: 9.0.2
#- GHC_VERSION: [8.8.4, 8.10.7, 9.0.2, 9.2.5]
#- GHC_VERSION: 8.6.5
# MULTIPLE_HIDDEN: "no"

#stack-build:
# extends: .common-local
# needs: []
# stage: test
# variables:
# GHC_VERSION: 8.10.7
# script:
# - .ci/stack_build.sh
#
#nix-build:
# image: nixos/nix:2.10.1
# needs: []
# stage: test
# before_script:
# - nix-env -i gawk
# script:
# - nix-build -j$(./.ci/effective_cpus.sh)
# tags:
# - local
#
#haddock:
# extends: .common-local
# needs: []
# stage: test
# variables:
# GHC_VERSION: 9.0.2
# artifacts:
# paths:
# - hadocs/*/*
# expire_in: 1 month
# script:
# - .ci/build_docs.sh
#
## # Run benchmarks for isclashfastyet.com
## benchmark-8.10.2:
## extends: .benchmark
#
## "Publish" a release candidate
#hackage-release-candidate:
# extends: .hackage
#
# variables:
# HACKAGE_RELEASE: "no"
#
# rules:
# - if: $CI_PIPELINE_SOURCE == "schedule"
# - if: $CI_PIPELINE_SOURCE == "trigger"
#
## Release new version of Clash to Hackage
#hackage-release:
# extends: .hackage
#
# variables:
# HACKAGE_RELEASE: "yes"
#
# rules:
# - if: '$CI_COMMIT_TAG != null' # tags

# Work around https://gitlab.com/gitlab-org/gitlab/-/issues/216629
#
Expand Down
6 changes: 5 additions & 1 deletion tests/src/Test/Tasty/Clash.hs
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ instance IsTest ClashBinaryTest where

buildArgs oDir =
[ "-package", "clash-testsuite"
, "-rtsopts"
, "-main-is", cbModName <> ".main" <> show cbBuildTarget
, "-o", oDir </> "out"
, "-i" <> cbSourceDirectory
Expand All @@ -307,7 +308,10 @@ instance IsTest ClashBinaryTest where
]

execProgram oDir =
TestHeisenbugProgram (oDir </> "out") (oDir:cbExtraExecArgs) NoGlob PrintStdErr False Nothing []
TestHeisenbugProgram (oDir </> "out")
( [ "+RTS", "-xm20000000", "-RTS" ]
<> (oDir:cbExtraExecArgs))
NoGlob PrintStdErr False Nothing []

testOptions = coerce (testOptions @TestProgram)

Expand Down

0 comments on commit 1669ed0

Please sign in to comment.