Skip to content

Commit 4262171

Browse files
committed
fix GitHub Actions
replace Magic Nix Cache with https://github.com/nix-community/cache-nix-action
1 parent 9677c9d commit 4262171

File tree

7 files changed

+103
-165
lines changed

7 files changed

+103
-165
lines changed
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# modified from https://github.com/jgm/pandoc/blob/master/.github/workflows/ci.yml
2+
name: Haskell library and example
3+
4+
concurrency:
5+
group: ${{ github.workflow }}-${{ github.ref }}
6+
cancel-in-progress: true
7+
8+
on:
9+
push:
10+
branches:
11+
- '**'
12+
paths-ignore: []
13+
pull_request:
14+
paths-ignore: []
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
strategy:
20+
matrix:
21+
ghc: ['9.6.7','9.8.4','9.10.1']
22+
cabal: ['3.14.2.0']
23+
os: [ubuntu-latest]
24+
name: Haskell GHC ${{ matrix.ghc }} sample
25+
steps:
26+
- uses: actions/checkout@v4
27+
- uses: haskell/[email protected]
28+
with:
29+
ghc: ${{ matrix.ghc }}
30+
cabal: ${{ matrix.cabal }}
31+
config: |
32+
# don't cache metadata files based on last access time
33+
meta-cache: 0
34+
# see https://github.com/haskell/ghcup-hs/blob/master/data/config.yaml
35+
# for full documentation
36+
url-source:
37+
- GHCupURL
38+
- prereleases
39+
- name: Cabal Update
40+
run: |
41+
cabal update
42+
43+
- name: Build Haskell
44+
run: |
45+
cabal build all --enable-tests
46+
47+
- uses: purescript-contrib/setup-purescript@main
48+
with:
49+
spago: "unstable"
50+
51+
- name: Cache PureScript dependencies
52+
uses: actions/[email protected]
53+
with:
54+
key: ${{ runner.os }}-spago-${{ hashFiles('**/spago.yaml') }}
55+
path: |
56+
.spago
57+
output
58+
test/RoundTripArgonautAesonGeneric/app/output
59+
test/RoundTripJsonHelpers/app/output
60+
61+
- name: Build PureScript
62+
run: |
63+
spago build
64+
cd test/RoundTripArgonautAesonGeneric/app
65+
spago build
66+
cd ../../../
67+
cd test/RoundTripJsonHelpers/app
68+
spago build
69+
70+
- name: Haskell Tests
71+
run: |
72+
cabal test all --disable-optimization
73+
74+
- name: Spago Tests
75+
run: |
76+
spago test

.github/workflows/haskell.yml

Lines changed: 0 additions & 106 deletions
This file was deleted.

.github/workflows/nix-flake.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
name: "Nix Flake"
2+
3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.ref }}
5+
cancel-in-progress: true
6+
27
on:
38
pull_request:
49
push:
@@ -7,8 +12,25 @@ jobs:
712
runs-on: ubuntu-latest
813
steps:
914
- uses: actions/checkout@v4
10-
- uses: DeterminateSystems/nix-installer-action@main
11-
- uses: DeterminateSystems/magic-nix-cache-action@main
15+
16+
- uses: nixbuild/nix-quick-install-action@v30
17+
with:
18+
nix_conf: |
19+
keep-env-derivations = true
20+
keep-outputs = true
21+
22+
- name: Restore and save Nix store
23+
uses: nix-community/cache-nix-action@v6
24+
with:
25+
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', '**/flake.lock') }}
26+
restore-prefixes-first-match: nix-${{ runner.os }}-
27+
gc-max-store-size-linux: 1G
28+
purge: true
29+
purge-prefixes: nix-${{ runner.os }}-
30+
purge-created: 0
31+
purge-last-accessed: 0
32+
purge-primary-key: never
33+
1234
- name: "Check `nix develop` shell"
1335
run: nix develop --check
1436
- name: "Check `nix develop` shell can run command"

.github/workflows/purescript.yml

Lines changed: 0 additions & 51 deletions
This file was deleted.

example/readme.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,7 @@ cabal run generate-purescript
5656

5757
- Generate the Javascript bundle:
5858
```
59-
spago bundle-app --to static/index.js
60-
```
61-
- or:
62-
```
63-
spago bundle-app --watch --to static/index.js
59+
spago bundle --bundle-type app --module ExampleMain --outfile static/index.js
6460
```
6561

6662
- Restart the server

example/src/MyLib.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,5 @@ api = Proxy
8181

8282
main :: IO ()
8383
main = do
84+
putStrLn "Running at port 8080..."
8485
run 8080 . serve api $ fooServer :<|> staticServer

purescript-bridge.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ library
3333
, Language.PureScript.Bridge.Tuple
3434
, Language.PureScript.Bridge.TypeInfo
3535
, Language.PureScript.Bridge.TypeParameters
36-
build-depends: base >=4.8 && < 6.0
36+
build-depends: base >=4.18 && < 6.0
3737
, containers
3838
, directory
3939
, filepath

0 commit comments

Comments
 (0)