Skip to content

Commit

Permalink
Fix release process (#898)
Browse files Browse the repository at this point in the history
* trying to fix nix build

* compiles with arm

* updating workflows

* debugging

* now run the tests

* installing hspec

* a different way

* add hpspec-discover

Co-authored-by: Ubuntu <ubuntu@ip-172-31-31-3.eu-north-1.compute.internal>
Co-authored-by: Ubuntu <ubuntu@ip-172-31-23-66.eu-north-1.compute.internal>
  • Loading branch information
3 people committed Nov 9, 2022
1 parent c8e2f1d commit 12473f0
Show file tree
Hide file tree
Showing 9 changed files with 79 additions and 32 deletions.
26 changes: 22 additions & 4 deletions .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
branches: [ master ]
paths:
- '.github/workflows/haskell.yml'
- 'stack*.yaml'
- 'cabal.project'
- 'hadolint.cabal'
- 'app/**'
- 'src/**'
Expand All @@ -32,6 +32,17 @@ jobs:

# setup:

- name: Set GHC_VERSION
uses: allenevans/set-env@v2.2.0
with:
GHC_VERSION: '9.2.5'

- if: matrix.os == 'windows-latest'
name: Set GHC_VERSION on windows
uses: allenevans/set-env@v2.2.0
with:
GHC_VERSION: '9.2.4'

- name: Check out
uses: actions/checkout@v3

Expand All @@ -40,8 +51,7 @@ jobs:
id: setup-haskell-cabal
uses: haskell/actions/setup@v2
with:
ghc-version: '8.10'
enable-stack: true
ghc-version: ${{ env.GHC_VERSION }}


- name: Update Cabal Index
Expand All @@ -60,5 +70,13 @@ jobs:

#actions

- name: Build
run: |
cabal configure --enable-tests
cabal build
- name: Test
run: stack test
run: |
cabal test all --test-show-details=direct
env:
HSPEC_OPTIONS: --color
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ jobs:
with:
nix_path: nixpkgs=channel:nixos-21.11
extra_nix_config: |
trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo=
substituters = https://hydra.iohk.io https://cache.nixos.org/ https://iohk.cachix.org
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
- uses: cachix/cachix-action@v10
with:
Expand Down
11 changes: 11 additions & 0 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
packages:
.

optional-packages:
vendored/**/*.cabal

source-repository-package
type: git
location: https://github.com/lorenzo/shellcheck
tag: 07095b233a60b819df6710b7741a59bac62179e1
--sha256: 114yfgp40klrm32al93j7fh7lzzg7scqqnf8cc953h2m22k0c48q
2 changes: 1 addition & 1 deletion default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ in
src = ./.;
};
# Specify the GHC version to use.
compiler-nix-name = "ghc8107";
compiler-nix-name = "ghc924";
}
4 changes: 3 additions & 1 deletion hadolint.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 2.0

-- This file has been generated from package.yaml by hpack version 0.34.6.
-- This file has been generated from package.yaml by hpack version 0.34.7.
--
-- see: https://github.com/sol/hpack

Expand Down Expand Up @@ -309,6 +309,8 @@ test-suite hadolint-unit-tests
ImplicitParams
OverloadedLists
ghc-options: -Wall -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints -optP-Wno-nonportable-include-path -flate-dmd-anal
build-tool-depends:
hspec-discover:hspec-discover ==2.*
build-depends:
HUnit >=1.2
, HsYAML
Expand Down
24 changes: 18 additions & 6 deletions nix/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
"homepage": "https://input-output-hk.github.io/haskell.nix",
"owner": "input-output-hk",
"repo": "haskell.nix",
"rev": "4b6ee9767daaf5fc1d5419e07733ab006b95ec93",
"sha256": "03hkqrdjbab0m16y3bpmcg4nvrnpajkbaa595v67r77hhqja3nqj",
"rev": "6c86f5254b33b4d2cb055309336351b1c536505b",
"sha256": "05kfccy0pl69rrc5vwgqrfl1a6y0hnfxr3i85dk3hn2pcn9gj5aq",
"type": "tarball",
"url": "https://github.com/input-output-hk/haskell.nix/archive/4b6ee9767daaf5fc1d5419e07733ab006b95ec93.tar.gz",
"url": "https://github.com/input-output-hk/haskell.nix/archive/6c86f5254b33b4d2cb055309336351b1c536505b.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"nixpkgs": {
Expand All @@ -17,10 +17,22 @@
"homepage": "",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "5f244caea76105b63d826911b2a1563d33ff1cdc",
"sha256": "1xlgynfw9svy7nvh9nkxsxdzncv9hg99gbvbwv3gmrhmzc3sar75",
"rev": "022caabb5f2265ad4006c1fa5b1ebe69fb0c3faf",
"sha256": "12q00nbd7fb812zchbcnmdg3pw45qhxm74hgpjmshc2dfmgkjh4n",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/5f244caea76105b63d826911b2a1563d33ff1cdc.tar.gz",
"url": "https://github.com/NixOS/nixpkgs/archive/022caabb5f2265ad4006c1fa5b1ebe69fb0c3faf.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"shellcheck-git": {
"branch": "remove-template-haskell-tests",
"description": "ShellCheck, a static analysis tool for shell scripts",
"homepage": "https://www.shellcheck.net",
"owner": "lorenzo",
"repo": "shellcheck",
"rev": "07095b233a60b819df6710b7741a59bac62179e1",
"sha256": "114yfgp40klrm32al93j7fh7lzzg7scqqnf8cc953h2m22k0c48q",
"type": "tarball",
"url": "https://github.com/lorenzo/shellcheck/archive/07095b233a60b819df6710b7741a59bac62179e1.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
}
}
22 changes: 20 additions & 2 deletions nix/sources.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,27 @@ let
if spec ? tag then "refs/tags/${spec.tag}" else
abort "In git source '${name}': Please specify `ref`, `tag` or `branch`!";
submodules = if spec ? submodules then spec.submodules else false;
submoduleArg =
let
nixSupportsSubmodules = builtins.compareVersions builtins.nixVersion "2.4" >= 0;
emptyArgWithWarning =
if submodules == true
then
builtins.trace
(
"The niv input \"${name}\" uses submodules "
+ "but your nix's (${builtins.nixVersion}) builtins.fetchGit "
+ "does not support them"
)
{}
else {};
in
if nixSupportsSubmodules
then { inherit submodules; }
else emptyArgWithWarning;
in
builtins.fetchGit { url = spec.repo; inherit (spec) rev; inherit ref; }
// (if builtins.compareVersions builtins.nixVersion "2.4" >= 0 then { inherit submodules; } else { });
builtins.fetchGit
({ url = spec.repo; inherit (spec) rev; inherit ref; } // submoduleArg);

fetch_local = spec: spec.path;

Expand Down
2 changes: 2 additions & 0 deletions package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,5 @@ tests:
- hadolint
- hspec >= 2.8.3
- silently
build-tools:
- hspec-discover == 2.*
16 changes: 0 additions & 16 deletions stack.yaml

This file was deleted.

0 comments on commit 12473f0

Please sign in to comment.