Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
NanuIjaz committed May 17, 2024
2 parents 4e61ddb + 235e34f commit 0d12185
Show file tree
Hide file tree
Showing 18 changed files with 478 additions and 12 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/actionlint-exceptions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.github/workflows/haskell.yml
.github/workflows/release-ghcr.yaml
.github/workflows/release-upload.yaml
.github/workflows/stylish-haskell.yml
39 changes: 39 additions & 0 deletions .github/workflows/actionlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Actionlint

on:
pull_request:

jobs:
actionlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

# We want to install Nix to provision shellcheck, so that actionlint doesn't install
# its own shellcheck. This will also make sure that this pipeline runs using
# the same shellcheck as the ones in Nix shells of developers.
- name: Install Nix with good defaults
uses: input-output-hk/install-nix-action@v20
with:
extra_nix_config: |
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
substituters = https://cache.nixos.org/ https://cache.iog.io/
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/install-nix-action@v18
with:
nix_path: nixpkgs=channel:nixos-unstable
# Make the Nix environment available to next steps
- uses: rrbutani/use-nix-shell-action@v1

- name: actionlint
run: |
for file in $(git ls-files ".github/workflows/*.y*ml")
do
if grep -q "$file" ".github/workflows/actionlint-exceptions.txt"
then
echo "⚠️ $file is ignored from actionlint's verifications. Please consider fixing it."
else
echo "actionlint $file"
actionlint "$file"
fi
done
2 changes: 1 addition & 1 deletion .github/workflows/github-page.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
tar -czf haddocks.tgz -C haddocks .
- name: Upload haddocks artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
if: ${{ always() }}
continue-on-error: true
with:
Expand Down
60 changes: 60 additions & 0 deletions .github/workflows/shellcheck-exceptions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
.github/bin/haddocks.sh
scripts/ci/check-cabal-files.sh
bench/process/process.sh
bench/script/probe.sh
cardano-submit-api/test/run.sh
cardano-tracer/demo/multi/run.sh
cardano-tracer/demo/ssh/run.sh
ci/check-dependencies-merged-to-master.sh
ci/check-hydra.sh
configuration/cardano/update-config-files.sh
nix/regenerate.sh
nix/workbench/analyse/analyse.sh
nix/workbench/backend/backend.sh
nix/workbench/backend/nomad.sh
nix/workbench/backend/nomad/cloud.sh
nix/workbench/backend/nomad/exec.sh
nix/workbench/backend/nomad/podman.sh
nix/workbench/backend/supervisor.sh
nix/workbench/chaindb.sh
nix/workbench/env.sh
nix/workbench/lib-cabal.sh
nix/workbench/lib.sh
nix/workbench/manifest.sh
nix/workbench/nomad.sh
nix/workbench/profile/pparams/apiPparamsImport.sh
nix/workbench/profile/pparams/diffLatest.sh
nix/workbench/profile/pparams/diffLatestWithOverlay.sh
nix/workbench/profile/pparams/pparamsLastWithOverlay.sh
nix/workbench/profile/profile.sh
nix/workbench/publish.sh
nix/workbench/run.sh
nix/workbench/scenario.sh
nix/workbench/topology/topology.sh
scripts/babbage/example-babbage-script-usage.sh
scripts/babbage/mkfiles.sh
scripts/babbage/script-context-equivalance-test.sh
scripts/babbage/script-mint-context-equivalance-test.sh
scripts/babbage/staking-example/claim-script-staking-rewards.sh
scripts/babbage/staking-example/register-and-delegate-script-staking-address.sh
scripts/bin-path.sh
scripts/byron-to-alonzo/burn.sh
scripts/byron-to-alonzo/mint.sh
scripts/byron-to-alonzo/mkfiles.sh
scripts/byron-to-alonzo/update-3.sh
scripts/byron-to-alonzo/update-4.sh
scripts/byron-to-alonzo/update-5.sh
scripts/ci/check-cabal-files.sh
scripts/gen-merge-summary.sh
scripts/lite/example-build-cmd.sh
scripts/lite/shelley-testnet-2.sh
scripts/lite/shelley-testnet.sh
scripts/lite/shutdown-ipc-example.sh
scripts/lite/split-txouts.sh
scripts/plutus/always-fails.sh
scripts/plutus/example-txin-locking-plutus-script.sh
scripts/plutus/script-context-equivalance-test.sh
scripts/plutus/script-context-equivalence-test-minting.sh
scripts/plutus/simple-minting-policy.sh
scripts/plutus/staking-example/claim-script-staking-rewards.sh
scripts/test-stake-cred-script/create-collateral.sh
40 changes: 40 additions & 0 deletions .github/workflows/shellcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Shellcheck
# This pipeline runs shellcheck on all files with extension .sh,
# except the ones listed in .github/workflows/shellcheck-exceptions.txt.
#
# This pipeline uses Nix, so that the shellcheck version used is the same
# ones as used by developers in Nix shells. This ensures the CI's behavior
# is consistent with the one of developers.

on:
pull_request:

jobs:
shellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Nix with good defaults
uses: input-output-hk/install-nix-action@v20
with:
extra_nix_config: |
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
substituters = https://cache.nixos.org/ https://cache.iog.io/
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/install-nix-action@v18
with:
nix_path: nixpkgs=channel:nixos-unstable
# Make the Nix environment available to next steps
- uses: rrbutani/use-nix-shell-action@v1
- name: shellcheck
run: |
for file in $(git ls-files "*.sh")
do
if grep -q "$file" ".github/workflows/shellcheck-exceptions.txt"
then
echo "⚠️ $file is ignored from shellcheck's verifications. Please consider fixing it."
else
echo "shellcheck $file"
shellcheck "$file"
fi
done
1 change: 1 addition & 0 deletions cardano-testnet/cardano-testnet.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ test-suite cardano-testnet-test
Cardano.Testnet.Test.Gov.DRepDeposit
Cardano.Testnet.Test.Gov.DRepRetirement
Cardano.Testnet.Test.Gov.InfoAction
Cardano.Testnet.Test.Gov.NoConfidence
Cardano.Testnet.Test.Gov.ProposeNewConstitution
Cardano.Testnet.Test.Gov.ProposeNewConstitutionSPO
Cardano.Testnet.Test.Gov.TreasuryGrowth
Expand Down
39 changes: 38 additions & 1 deletion cardano-testnet/src/Testnet/Defaults.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,16 @@ module Testnet.Defaults
, defaultByronProtocolParamsJsonValue
, defaultYamlConfig
, defaultConwayGenesis
, defaultCommitteeKeyPair
, defaultCommitteeVkeyFp
, defaultCommitteeSkeyFp
, defaultDRepSkeyFp
, defaultDRepKeyPair
, defaultDelegatorStakeKeyPair
, defaultSpoKeys
, defaultSpoColdKeyPair
, defaultSPOColdVKeyFp
, defaultSPOColdSKeyFp
, defaultSpoKeys
, defaultShelleyGenesis
, defaultGenesisFilepath
, defaultYamlHardforkViaConfig
Expand Down Expand Up @@ -491,6 +497,16 @@ defaultGenesisFilepath era =
-- This path is actually generated by create-testnet-data. Don't change it.
eraToString era <> "-genesis.json"

defaultCommitteeVkeyFp
:: Int -- ^ The Committee's index (starts at 1)
-> FilePath
defaultCommitteeVkeyFp n = "committee-keys" </> "committee" <> show n <> ".vkey"

defaultCommitteeSkeyFp
:: Int -- ^ The Committee's index (starts at 1)
-> FilePath
defaultCommitteeSkeyFp n = "committee-keys" </> "committee" <> show n <> ".skey"

-- | The relative path to DRep keys in directories created by cardano-testnet
defaultDRepKeyPair
:: Int -- ^ The DRep's index (starts at 1)
Expand All @@ -501,6 +517,27 @@ defaultDRepKeyPair n =
, signingKey = File $ "drep-keys" </> ("drep" <> show n) </> "drep.skey"
}

-- | The relative path to DRep secret keys in directories created by cardano-testnet
defaultDRepSkeyFp
:: Int -- ^ The DRep's index (starts at 1)
-> FilePath
defaultDRepSkeyFp n = "drep-keys" </> ("drep" <> show n) </> "drep.skey"

defaultCommitteeKeyPair :: Int -> KeyPair PaymentKey
defaultCommitteeKeyPair n =
KeyPair
{ verificationKey = File $ defaultCommitteeVkeyFp n
, signingKey = File $ defaultCommitteeSkeyFp n
}

-- | The relative path to SPO cold verification key in directories created by cardano-testnet
defaultSPOColdVKeyFp :: Int -> FilePath
defaultSPOColdVKeyFp n = "pools-keys" </> "pool" <> show n </> "cold.vkey"

-- | The relative path to SPO cold secret key in directories created by cardano-testnet
defaultSPOColdSKeyFp :: Int -> FilePath
defaultSPOColdSKeyFp n = "pools-keys" </> "pool" <> show n </> "cold.skey"

-- | The relative path to SPO keys in directories created by cardano-testnet
defaultSpoColdKeyPair
:: Int
Expand Down
19 changes: 19 additions & 0 deletions cardano-testnet/src/Testnet/Process/Run.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ module Testnet.Process.Run
, procSubmitApi
, procChairman
, mkExecConfig
, mkExecConfigOffline
, ProcessError(..)
, ExecutableError(..)
) where
Expand Down Expand Up @@ -190,6 +191,24 @@ mkExecConfig tempBaseAbsPath sprocket networkId = do
, H.execConfigCwd = Last $ Just tempBaseAbsPath
}

-- | Creates an 'ExecConfig' that can be used to run a process offline.
-- e.g cardano-cli without a node running.
mkExecConfigOffline :: ()
=> MonadTest m
=> MonadIO m
=> FilePath
-> m ExecConfig
mkExecConfigOffline tempBaseAbsPath = do
env' <- H.evalIO IO.getEnvironment

return H.ExecConfig
{ H.execConfigEnv = Last $ Just
-- The environment must be passed onto child process on Windows in order to
-- successfully start that process.
env'
, H.execConfigCwd = Last $ Just tempBaseAbsPath
}


data ProcessError
= ProcessIOException IOException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import qualified Hedgehog.Extras as H
hprop_ledger_events_drep_deposits :: Property
hprop_ledger_events_drep_deposits = integrationWorkspace "drep-deposits" $ \tempAbsBasePath' -> runWithDefaultWatchdog_ $ do

-- Start a local test net

conf@Conf { tempAbsPath } <- mkConf tempAbsBasePath'
let tempAbsPath' = unTmpAbsPath tempAbsPath
tempBaseAbsPath = makeTmpBaseAbsPath tempAbsPath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import qualified Hedgehog.Extras as H
hprop_ledger_events_info_action :: Property
hprop_ledger_events_info_action = integrationRetryWorkspace 0 "info-hash" $ \tempAbsBasePath' -> runWithDefaultWatchdog_ $ do

-- Start a local test net

conf@Conf { tempAbsPath } <- H.noteShowM $ mkConf tempAbsBasePath'
let tempAbsPath' = unTmpAbsPath tempAbsPath
tempBaseAbsPath = makeTmpBaseAbsPath tempAbsPath
Expand Down
Loading

0 comments on commit 0d12185

Please sign in to comment.