Skip to content

Commit b6cea33

Browse files
authored
Merge branch 'master' into lc/yarn-docs
2 parents 6e8acf5 + 4dc0ede commit b6cea33

File tree

3 files changed

+49
-6
lines changed

3 files changed

+49
-6
lines changed

.github/workflows/nightly-ci.yaml

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@ permissions:
1717

1818
jobs:
1919
build-test:
20-
name: "Nightly Blockfrost e2d tests"
20+
name: "Nightly Blockfrost e2e tests"
2121
runs-on: ubuntu-latest
2222
strategy:
2323
matrix:
2424
include:
2525
- package: hydra-cluster
26+
env:
27+
HYDRA_BACKEND: blockfrost
2628
steps:
2729
- name: 📥 Checkout repository
2830
uses: actions/checkout@v4
@@ -37,10 +39,36 @@ jobs:
3739
if [[ "${{secrets.blockfrost_token}}" != '' ]]; then
3840
echo "${{secrets.blockfrost_token}}" > blockfrost-project.txt
3941
cd ${{ matrix.package }}
40-
export HYDRA_BACKEND="blockfrost"
41-
nix build .#${{ matrix.package }}-tests
42-
nix develop
43-
cabal test hydra-cluster --test-options '-m "End-to-end on Cardano devnet"'
42+
nix develop .#${{ matrix.package }}-tests --command tests -m "End-to-end on Cardano devnet"
4443
else
4544
echo "::warning file=blockfrost-project.txt,title=BLOCKFROST::Missing blockfrost project file."
4645
fi
46+
47+
48+
other-nightly-tests:
49+
name: "Nightly tests"
50+
runs-on: ubuntu-latest
51+
strategy:
52+
matrix:
53+
include:
54+
- package: hydra-plutus
55+
- package: hydra-tx
56+
- package: hydra-chain-observer
57+
- package: hydra-node
58+
- package: hydra-cluster
59+
# Note: Missing hydra-tui
60+
env:
61+
CI_NIGHTLY: True
62+
steps:
63+
- name: 📥 Checkout repository
64+
uses: actions/checkout@v4
65+
66+
- name: ❄ Setup Nix/Cachix
67+
uses: ./.github/actions/nix-cachix-setup
68+
with:
69+
authToken: '${{ secrets.CACHIX_CARDANO_SCALING_AUTH_TOKEN }}'
70+
71+
- name: Run tests
72+
run: |
73+
cd ${{ matrix.package }}
74+
nix develop .#${{ matrix.package }}-tests --command tests -m "@nightly"

hydra-node/test/Hydra/Events/S3Spec.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import Hydra.Events.S3 (fromObjectKey, newS3EventStore, purgeEvents, toObjectKey
1212
import Test.QuickCheck (chooseBoundedIntegral, counterexample, forAllShrink, ioProperty, sized, sublistOf, withMaxSuccess, (===))
1313

1414
spec :: Spec
15-
spec = do
15+
spec = around_ onlyNightly $ describe "AWS S3 @nightly" $ do
1616
prop "ObjectKey <-> EventId" $ \eventId ->
1717
let key = toObjectKey eventId
1818
in fromObjectKey @(Either String) key === Right eventId

hydra-test-utils/src/Test/Hydra/Prelude.hs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ module Test.Hydra.Prelude (
1515
checkProcessHasNotDied,
1616
exceptionContaining,
1717
withClearedPATH,
18+
onlyNightly,
1819
) where
1920

2021
import Hydra.Prelude
@@ -206,3 +207,17 @@ withClearedPATH act =
206207
env <- getEnv "PATH"
207208
setEnv "PATH" ""
208209
pure env
210+
211+
-- | Only run this task when the CI_NIGHTLY environment variable is set (to
212+
-- anything).
213+
--
214+
-- If you're using this, you want to tag the test with `@nightly` as well;
215+
-- like:
216+
--
217+
-- spec = around_ onlyNightly $ describe "... @nightly" $ do
218+
-- ...
219+
onlyNightly :: IO () -> IO ()
220+
onlyNightly action = do
221+
lookupEnv "CI_NIGHTLY" >>= \case
222+
Nothing -> pendingWith "Only runs nightly"
223+
Just _ -> action

0 commit comments

Comments
 (0)