Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DONTMERGE: Lc/ci testing #1306

Closed
wants to merge 17 commits into from
15 changes: 1 addition & 14 deletions .github/workflows/binaries.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,14 @@ jobs:
# libraries statically linked into it.
build-executables-linux:
name: "Build x86_64-linux static executables"
runs-on: ubuntu-latest
runs-on: self-hosted
steps:
- name: 📥 Checkout repository
uses: actions/checkout@v4
with:
# Also ensure we have all history with all tags
fetch-depth: 0

- name: ❄ Prepare nix
uses: cachix/install-nix-action@v25
with:
extra_nix_config: |
accept-flake-config = true
log-lines = 1000

- name: ❄ Cachix cache of nix derivations
uses: cachix/cachix-action@v14
with:
name: cardano-scaling
authToken: '${{ secrets.CACHIX_CARDANO_SCALING_AUTH_TOKEN }}'

- name: ❄ Build static executables
run: |
nix build .#release-static
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/cardano-node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,14 @@ on:
jobs:
build-executables-linux:
name: "Build x86_64-linux static executables"
runs-on: ubuntu-latest
runs-on: self-hosted
steps:
- name: 📥 Checkout cardano-node 8.7.2
uses: actions/checkout@v4
with:
repository: IntersectMBO/cardano-node
ref: 8.7.2

- name: ❄ Prepare nix
uses: cachix/install-nix-action@v25
with:
extra_nix_config: |
accept-flake-config = true
log-lines = 1000

- name: ❄ Build cardano-node static executables
run: |
mkdir -p out/
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-tutorial.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
jobs:
check-tutorial:
name: "Check tutorial"
runs-on: ubuntu-latest
runs-on: self-hosted
steps:
- uses: actions/checkout@v4

Expand Down
67 changes: 7 additions & 60 deletions .github/workflows/ci-nix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,33 +18,19 @@ on:
jobs:
build-test:
name: "Build & test"
runs-on: ubuntu-latest
runs-on: self-hosted
strategy:
matrix:
include:
- package: plutus-cbor
- package: plutus-merkle-tree
- package: hydra-plutus
- package: hydra-tui
- package: hydra-node
- package: hydra-cluster
steps:
- name: 📥 Checkout repository
uses: actions/checkout@v4

- name: ❄ Prepare nix
uses: cachix/install-nix-action@v25
with:
extra_nix_config: |
accept-flake-config = true
log-lines = 1000

- name: ❄ Cachix cache of nix derivations
uses: cachix/cachix-action@v14
with:
name: cardano-scaling
authToken: '${{ secrets.CACHIX_CARDANO_SCALING_AUTH_TOKEN }}'

- name: ❓ Test
if: ${{ matrix.package != 'hydra-tui' }}
run: |
Expand Down Expand Up @@ -84,7 +70,7 @@ jobs:
publish-test-results:
name: Publish test results
needs: [build-test]
runs-on: ubuntu-latest
runs-on: self-hosted
steps:
- name: 📥 Download test results
uses: actions/download-artifact@v4
Expand All @@ -99,24 +85,11 @@ jobs:

haddock:
name: "Build haddock using nix"
runs-on: ubuntu-latest
runs-on: self-hosted
steps:
- name: 📥 Checkout repository
uses: actions/checkout@v4

- name: ❄ Prepare nix
uses: cachix/install-nix-action@v25
with:
extra_nix_config: |
accept-flake-config = true
log-lines = 1000

- name: ❄ Cachix cache of nix derivations
uses: cachix/cachix-action@v14
with:
name: cardano-scaling
authToken: '${{ secrets.CACHIX_CARDANO_SCALING_AUTH_TOKEN }}'

- name: 📚 Documentation (Haddock)
run: |
nix build .#haddocks
Expand All @@ -131,7 +104,7 @@ jobs:

benchmarks:
name: "Benchmarks"
runs-on: ubuntu-latest
runs-on: self-hosted
strategy:
matrix:
include:
Expand All @@ -151,19 +124,6 @@ jobs:
- name: 📥 Checkout repository
uses: actions/checkout@v4

- name: ❄ Prepare nix
uses: cachix/install-nix-action@v25
with:
extra_nix_config: |
accept-flake-config = true
log-lines = 1000

- name: ❄ Cachix cache of nix derivations
uses: cachix/cachix-action@v14
with:
name: cardano-scaling
authToken: '${{ secrets.CACHIX_CARDANO_SCALING_AUTH_TOKEN }}'

- name: 📈 Benchmark
run: |
mkdir -p benchmarks
Expand All @@ -190,7 +150,7 @@ jobs:
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
# TODO: this is actually only requires the tx-cost benchmark results
needs: [benchmarks]
runs-on: ubuntu-latest
runs-on: self-hosted
steps:
- name: 📥 Download generated documentation
uses: actions/download-artifact@v4
Expand Down Expand Up @@ -224,24 +184,11 @@ jobs:

build-specification:
name: "Build specification using nix"
runs-on: ubuntu-latest
runs-on: self-hosted
steps:
- name: 📥 Checkout repository
uses: actions/checkout@v4

- name: ❄ Prepare nix
uses: cachix/install-nix-action@v25
with:
extra_nix_config: |
accept-flake-config = true
log-lines = 1000

- name: ❄ Cachix cache of nix derivations
uses: cachix/cachix-action@v14
with:
name: cardano-scaling
authToken: '${{ secrets.CACHIX_CARDANO_SCALING_AUTH_TOKEN }}'

- name: ❄ Build specification PDF
run: |
nix build .#spec && cp result/*.pdf spec/
Expand All @@ -256,7 +203,7 @@ jobs:
documentation:
name: Documentation
needs: [haddock,benchmarks,build-test,build-specification]
runs-on: ubuntu-latest
runs-on: self-hosted
steps:
- name: 📥 Checkout repository
uses: actions/checkout@v4
Expand Down
15 changes: 1 addition & 14 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
matrix:
target: [ hydra-node, hydra-tui, hydraw, hydra-explorer ]

runs-on: ubuntu-latest
runs-on: self-hosted
steps:
- name: 📥 Checkout repository
uses: actions/checkout@v4
Expand All @@ -32,19 +32,6 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: ❄ Prepare nix
uses: cachix/install-nix-action@v25
with:
extra_nix_config: |
accept-flake-config = true
log-lines = 1000

- name: ❄ Cachix cache of nix derivations
uses: cachix/cachix-action@v14
with:
name: cardano-scaling
authToken: '${{ secrets.CACHIX_CARDANO_SCALING_AUTH_TOKEN }}'

- name: 🔨 Build image using nix
run: |
IMAGE_NAME=ghcr.io/${{github.repository_owner}}/${{matrix.target}}
Expand Down
15 changes: 1 addition & 14 deletions .github/workflows/formatting.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,11 @@ on:
jobs:
formatting:
name: Check code formatting
runs-on: ubuntu-latest
runs-on: self-hosted
steps:
- name: 📥 Checkout repository
uses: actions/checkout@v4

- name: ❄ Prepare nix
uses: cachix/install-nix-action@v25
with:
extra_nix_config: |
accept-flake-config = true
log-lines = 1000

- name: ❄ Cachix cache of nix derivations
uses: cachix/cachix-action@v14
with:
name: cardano-scaling
authToken: '${{ secrets.CACHIX_CARDANO_SCALING_AUTH_TOKEN }}'

- name: 📐 Check code formatting
run: |
nix develop .#fmt --command treefmt --fail-on-change
16 changes: 16 additions & 0 deletions .github/workflows/hlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Check hlint

on:
pull_request:

jobs:
hlint:
name: Check hlint
runs-on: self-hosted
steps:
- name: 📥 Checkout repository
uses: actions/checkout@v4

- name: 📐 Check hlint
run: |
nix develop .#fmt --command hlint .
2 changes: 1 addition & 1 deletion .github/workflows/publish-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
jobs:
publishing:
name: Publish Documentation
runs-on: ubuntu-latest
runs-on: self-hosted
# if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:

Expand Down
2 changes: 2 additions & 0 deletions .hlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- ignore: {name: Redundant <$>, within: [Hydra.Contract.HeadTokens]}
- ignore: {name: Redundant compare, within: [Hydra.PartySpec]}
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# <p align="center">Hydra :dragon_face:</p>











<div align="center">
<p>Implementation of the Hydra scalability protocols.</p>
<a href='https://github.com/input-output-hk/hydra/actions'><img src="https://img.shields.io/github/actions/workflow/status/input-output-hk/hydra/ci-nix.yaml?branch=master&label=Tests&style=for-the-badge" /></a>
Expand Down
3 changes: 1 addition & 2 deletions hydra-cardano-api/src/Hydra/Cardano/Api/ScriptHash.hs
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,4 @@ hashScriptInAnyLang (ScriptInAnyLang _ script) =

instance Arbitrary ScriptHash where
arbitrary = do
plutusScript <- arbitrary
pure $ hashScript (PlutusScript PlutusScriptV2 plutusScript)
hashScript . PlutusScript PlutusScriptV2 <$> arbitrary
2 changes: 1 addition & 1 deletion hydra-cardano-api/src/Hydra/Cardano/Api/TxOut.hs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ fromPlutusTxOut ::
Plutus.TxOut ->
Maybe (TxOut CtxUTxO era)
fromPlutusTxOut network out = do
value <- shelleyBasedEraConstraints (shelleyBasedEra @era) $ TxOutValueShelleyBased (shelleyBasedEra @era) <$> (toLedgerValue (maryEraOnwards @era) <$> fromPlutusValue plutusValue)
value <- shelleyBasedEraConstraints (shelleyBasedEra @era) (TxOutValueShelleyBased (shelleyBasedEra @era) . toLedgerValue (maryEraOnwards @era) <$> fromPlutusValue plutusValue)
pure $ TxOut addressInEra value datum ReferenceScriptNone
where
addressInEra = fromPlutusAddress network plutusAddress
Expand Down
1 change: 0 additions & 1 deletion hydra-cluster/bench/Main.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE OverloadedRecordDot #-}

module Main where

Expand Down
16 changes: 8 additions & 8 deletions hydra-cluster/src/Hydra/Cluster/Mithril.hs
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ downloadLatestSnapshotTo tracer network directory = do

genesisKeyURLForNetwork :: KnownNetwork -> Maybe String
genesisKeyURLForNetwork = \case
Mainnet -> Just $ "https://raw.githubusercontent.com/input-output-hk/mithril/main/mithril-infra/configuration/release-mainnet/genesis.vkey"
Preproduction -> Just $ "https://raw.githubusercontent.com/input-output-hk/mithril/main/mithril-infra/configuration/release-preprod/genesis.vkey"
Preview -> Just $ "https://raw.githubusercontent.com/input-output-hk/mithril/main/mithril-infra/configuration/pre-release-preview/genesis.vkey"
Sanchonet -> Just $ "https://raw.githubusercontent.com/input-output-hk/mithril/main/mithril-infra/configuration/testing-sanchonet/genesis.vkey"
Mainnet -> Just "https://raw.githubusercontent.com/input-output-hk/mithril/main/mithril-infra/configuration/release-mainnet/genesis.vkey"
Preproduction -> Just "https://raw.githubusercontent.com/input-output-hk/mithril/main/mithril-infra/configuration/release-preprod/genesis.vkey"
Preview -> Just "https://raw.githubusercontent.com/input-output-hk/mithril/main/mithril-infra/configuration/pre-release-preview/genesis.vkey"
Sanchonet -> Just "https://raw.githubusercontent.com/input-output-hk/mithril/main/mithril-infra/configuration/testing-sanchonet/genesis.vkey"

aggregatorEndpointForNetwork :: KnownNetwork -> Maybe String
aggregatorEndpointForNetwork = \case
Mainnet -> Just $ "https://aggregator.release-mainnet.api.mithril.network/aggregator"
Preproduction -> Just $ "https://aggregator.release-preprod.api.mithril.network/aggregator"
Preview -> Just $ "https://aggregator.pre-release-preview.api.mithril.network/aggregator"
Sanchonet -> Just $ "https://aggregator.testing-sanchonet.api.mithril.network/aggregator"
Mainnet -> Just "https://aggregator.release-mainnet.api.mithril.network/aggregator"
Preproduction -> Just "https://aggregator.release-preprod.api.mithril.network/aggregator"
Preview -> Just "https://aggregator.pre-release-preview.api.mithril.network/aggregator"
Sanchonet -> Just "https://aggregator.testing-sanchonet.api.mithril.network/aggregator"
6 changes: 3 additions & 3 deletions hydra-cluster/test/Test/Hydra/Cluster/CardanoCliSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ spec =
it "query protocol-parameters is compatible with our FromJSON instance" $ \tracer ->
withTempDir "hydra-cluster" $ \tmpDir -> do
withCardanoNodeDevnet tracer tmpDir $ \RunningNode{nodeSocket, networkId} -> do
protocolParameters <- cliQueryProtocolParameters nodeSocket (networkId)
case (parseEither pparamsFromJson protocolParameters) of
protocolParameters <- cliQueryProtocolParameters nodeSocket networkId
case parseEither pparamsFromJson protocolParameters of
Left e -> failure $ "Failed to decode JSON: " <> e <> "\n" <> show protocolParameters
Right _ -> pure ()

it "query protocol-parameters matches our schema" $ \tracer ->
withJsonSpecifications $ \tmpDir ->
withCardanoNodeDevnet tracer tmpDir $ \RunningNode{nodeSocket, networkId} -> do
pparamsValue <- cliQueryProtocolParameters nodeSocket (networkId)
pparamsValue <- cliQueryProtocolParameters nodeSocket networkId
validateJSON
(tmpDir </> "api.json")
(key "components" . key "schemas" . key "ProtocolParameters")
Expand Down
Loading
Loading