1515 required : true
1616 description : ' compiler name in nix format. e.g. ghc96'
1717 type : string
18- minimal :
19- description : ' without hls, hlint, ...'
20- type : boolean
21- default : true
18+ variant :
19+ description : ' if set to `minimal` without hls, hlint, ...'
20+ type : string
21+ default : ' '
2222 iog :
23- description : ' with iog libs: libsodium, libsecp256k1, libblst, ...'
24- type : boolean # FIXME: this should rather be a 'string' that could be set to 'full' ...
25- default : false
26- iog-full :
27- description : ' with full iog libs: libsodium, libsecp256k1, libblst, postgresql, R, ...'
28- type : boolean
29- default : false
23+ description : ' if set to `-iog` with libs `libsodium`, `libsecp256k1`, `libblst`, ... and if set to `-iog-full` adds `postgresql` and `R`'
24+ type : string
25+ default : ' '
3026
3127env :
3228 REGISTRY : ghcr.io
3329 IMAGE_NAME : ${{ github.repository }}
34- DEV_SHELL : ${{ inputs.platform }}.${{ inputs.compiler-nix-name }}${{ inputs.target-platform }}${{ inputs.minimal && '-minimal' || '' }}${{ ( inputs.iog-full && '-iog-full') || (inputs.iog && '-iog') || '' }}-env
30+ DEV_SHELL : ${{ inputs.platform }}.${{ inputs.compiler-nix-name }}${{ inputs.target-platform }}${{ inputs.variant }}${{ inputs.iog }}-env
3531 DEFAULT_TAG : latest
3632 GH_TOKEN : ${{ github.token }}
3733
@@ -120,7 +116,7 @@ jobs:
120116 # Likely, we consider using `-iog` as the default and do not generate other images.
121117 # Then the user choices left would be between native, `-windows` or `-js` target platforms,
122118 # and the GHC version (currently `ghc810` and `ghc96`).
123- if : ${{ contains(fromJSON('["x86_64-linux", "aarch64-linux"]'), inputs.platform) && contains(fromJson('["","-windows","-js"]'), inputs.target-platform) && contains(fromJson('["ghc810","ghc96"]'), inputs.compiler-nix-name) && ! inputs.minimal && inputs.iog && ! inputs.iog-full }}
119+ if : ${{ contains(fromJSON('["x86_64-linux", "aarch64-linux"]'), inputs.platform) && contains(fromJson('["","-windows","-js"]'), inputs.target-platform) && contains(fromJson('["ghc810","ghc96"]'), inputs.compiler-nix-name) && inputs.variant == '' && inputs.iog == '-iog' }}
124120 steps :
125121 - name : Checkout repository
126122 uses : actions/checkout@v3
@@ -137,42 +133,14 @@ jobs:
137133 with :
138134 context : .
139135 push : true
140- tags : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ inputs.platform }}.${{ inputs.compiler-nix-name }}${{ inputs.target-platform }}${{ ( inputs.iog-full && '-iog-full') || ( inputs.iog && '-iog') }}
136+ tags : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ inputs.platform }}.${{ inputs.compiler-nix-name }}${{ inputs.target-platform }}${{ inputs.variant }}${{ inputs.iog }}
141137 build-args : |
142138 PLATFORM=${{ inputs.platform }}
143139 TARGET_PLATFORM=${{ inputs.target-platform }}
144140 COMPILER_NIX_NAME=${{ inputs.compiler-nix-name }}
145- MINIMAL =${{ inputs.minimal }}
141+ VARIANT =${{ inputs.variant }}
146142 IOG=${{ inputs.iog }}
147- IOG_FULL=${{ inputs.iog-full }}
148-
149- codespace-download :
150- env :
151- IMAGE_NAME : input-output-hk/devx-devcontainer
152- needs : codespace-upload
153- permissions :
154- packages : write
155- runs-on : ubuntu-latest
156- # We want a GitHub Codespace image for each combination of devx developer shell option.
157- # But, since the purpose of GitHub Codespace is to serve a complete development environment,
158- # the user is likely to always expect HLS (I don't see the point otherwise).
159- # Therefore, it doesn't seem useful to build an image on the `-minimal` flavor (without HLS),
160- # or the `-static` one (especially since the latter currently requires `-minimal` to work).
161- # Likely, we consider using `-iog` as the default and do not generate other images.
162- # Then the user choices left would be between native, `-windows` or `-js` target platforms,
163- # and the GHC version (currently `ghc810` and `ghc96`).
164- if : ${{ contains(fromJSON('["x86_64-linux", "aarch64-linux"]'), inputs.platform) && contains(fromJson('["","-windows","-js"]'), inputs.target-platform) && contains(fromJson('["ghc810","ghc96"]'), inputs.compiler-nix-name) && !inputs.minimal && inputs.iog }}
165- steps :
166- - name : Checkout repository
167- uses : actions/checkout@v3
168-
169- - name : Log in to the Container registry
170- uses : docker/login-action@v2.1.0
171- with :
172- registry : ${{ env.REGISTRY }}
173- username : ${{ github.actor }}
174- password : ${{ secrets.GITHUB_TOKEN }}
175143
176144 - name : Run test command inside the Dev Container
177- run : docker run --rm ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ inputs.platform }}.${{ inputs.compiler-nix-name }}${{ inputs.target-platform }} \
145+ run : docker run --rm ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ inputs.platform }}.${{ inputs.compiler-nix-name }}${{ inputs.target-platform }}${{ inputs.variant }}${{ inputs.iog }} \
178146 /bin/bash -c "cabal update && cabal unpack hello && cd hello-* && cabal build"
0 commit comments