Bump cachix/install-nix-action from 26 to 27 (#528) #1085
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
jobs: | |
cabal: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
ghc: ['8.10', '9.0', '9.2'] | |
os: [ubuntu-latest, macOS-latest, windows-latest] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
- uses: haskell/actions/setup@v2 | |
id: setup-haskell | |
with: | |
ghc-version: ${{ matrix.ghc }} | |
- uses: actions/[email protected] | |
with: | |
path: | | |
${{ steps.setup-haskell-cabal.outputs.cabal-store }} | |
dist-newstyle | |
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }} | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.ghc }}- | |
- name: Install system dependencies Linux | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
sudo apt-get update | |
sudo apt-get install libsdl2-dev | |
- name: Install system dependencies macOS | |
if: matrix.os == 'macOS-latest' | |
shell: bash | |
run: | | |
brew install pkg-config sdl2 | |
- name: Install system dependencies Windows | |
if: matrix.os == 'windows-latest' | |
shell: bash | |
run: | | |
for i in $(seq 5); do | |
choco install pkgconfiglite --download-checksum=2038c49d23b5ca19e2218ca89f06df18fe6d870b4c6b54c0498548ef88771f6f --download-checksum-type=sha256 && | |
break || sleep 15; | |
done | |
curl -L https://www.libsdl.org/release/SDL2-devel-2.28.4-mingw.tar.gz | tar xz | |
SDL2=$(cygpath --windows --absolute "SDL2-2.28.4/x86_64-w64-mingw32") | |
printf "%s\n" "$SDL2/bin" >> "$GITHUB_PATH" | |
printf "%s\n" "PKG_CONFIG_PATH=$SDL2/lib/pkgconfig" >> "$GITHUB_ENV" | |
cat >> cabal.project <<EOF | |
package sdl2 | |
extra-lib-dirs: $SDL2/lib/ | |
extra-include-dirs: $SDL2/include/SDL2/ | |
EOF | |
- name: Prepare Vulkan SDK | |
uses: humbletim/[email protected] | |
with: | |
vulkan-query-version: latest | |
vulkan-components: Vulkan-Headers, Vulkan-Loader, Glslang | |
vulkan-use-cache: true | |
- name: Make libvulkan.1.dylib available on OSX | |
if: matrix.os == 'macOS-latest' | |
shell: bash | |
run: | | |
file $VULKAN_SDK/lib/libvulkan.1.dylib | |
ln -s $VULKAN_SDK/lib/libvulkan.1.dylib /usr/local/lib/libvulkan.1.dylib | |
- name: Inform Cabal about Vulkan | |
shell: bash | |
run: | | |
cat >> cabal.project <<EOF | |
extra-lib-dirs: $VULKAN_SDK/lib/ | |
extra-include-dirs: $VULKAN_SDK/include/ | |
EOF | |
printf "%s\n" "$VULKAN_SDK/bin" >> "$GITHUB_PATH" | |
if uname -s | grep -i mingw; then sep=';'; else sep=':'; fi | |
printf "%s\n" "PKG_CONFIG_PATH=${PKG_CONFIG_PATH:+${PKG_CONFIG_PATH}${sep}}$VULKAN_SDK/lib/pkgconfig" >> "$GITHUB_ENV" | |
# until this is fixed https://github.com/haskell/cabal/issues/7339 | |
printf "%s\n" "DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH:+${DYLD_LIBRARY_PATH}${sep}}$VULKAN_SDK/lib" >> "$GITHUB_ENV" | |
- name: Remove openxr | |
run: | | |
sed -ibak '/openxr/d' cabal.project | |
- name: Remove generator for all but 8.10 and 9.0 | |
run: | | |
sed -ibak '/generate-new/d' cabal.project | |
if: matrix.ghc != '8.10' || matrix.ghc != '9.0' | |
- run: cabal update | |
- run: | | |
if command -v glslc &> /dev/null; then | |
cabal configure -fgeneric-instances -f-raytracing -fhave-shaderc | |
else | |
echo "glslc could not be found" | |
cabal configure -fgeneric-instances -f-raytracing -f-have-shaderc | |
fi | |
shell: bash | |
- name: Install dependencies | |
run: cabal build --only-dependencies --enable-tests --enable-benchmarks all | |
- name: Build vulkan | |
run: cabal build --enable-tests --enable-benchmarks vulkan | |
- name: Build VulkanMemoryAllocator | |
run: cabal build --enable-tests --enable-benchmarks VulkanMemoryAllocator | |
- name: Build vulkan-utils | |
run: cabal build --enable-tests --enable-benchmarks vulkan-utils | |
- name: Build vulkan-examples | |
run: cabal build --enable-tests --enable-benchmarks vulkan-examples | |
- run: cabal check | |
- name: Build documentation | |
run: | | |
cabal haddock | |
cabal haddock VulkanMemoryAllocator | |
cabal haddock vulkan-utils | |
stack: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macOS-latest, windows-latest] | |
stack-args: ['--flag vulkan:generic-instances --flag VulkanMemoryAllocator:generic-instances --flag vulkan-examples:-raytracing --flag vulkan-examples:-have-shaderc --system-ghc'] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
- uses: haskell/actions/setup@v2 | |
with: | |
stack-version: 'latest' | |
enable-stack: true | |
ghc-version: '8.10' | |
- name: Cache stack things | |
uses: actions/[email protected] | |
with: | |
path: | | |
~/.stack | |
.stack-work | |
key: ${{ runner.os }}-stack-global-${{ matrix.stack-args }}-${{ hashFiles('**.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-stack-global-${{ matrix.stack-args }} | |
${{ runner.os }}-stack-global | |
- name: Set up yq | |
uses: frenck/action-setup-yq@v1 | |
with: {version: v4.30.5} # frenck/action-setup-yq#35 | |
- name: Install system dependencies Linux | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
sudo apt-get update | |
sudo apt-get install libsdl2-dev | |
- name: Install system dependencies Windows | |
if: matrix.os == 'windows-latest' | |
shell: bash | |
run: | | |
for i in $(seq 5); do | |
choco install pkgconfiglite --download-checksum=2038c49d23b5ca19e2218ca89f06df18fe6d870b4c6b54c0498548ef88771f6f --download-checksum-type=sha256 && | |
break || sleep 15; | |
done | |
curl -L https://www.libsdl.org/release/SDL2-devel-2.0.12-mingw.tar.gz | tar xz | |
SDL2=$(cygpath --windows --absolute "SDL2-2.0.12/x86_64-w64-mingw32") | |
printf "%s\n" "$SDL2/bin" >> "$GITHUB_PATH" | |
printf "%s\n" "PKG_CONFIG_PATH=$SDL2/lib/pkgconfig" >> "$GITHUB_ENV" | |
yq --inplace ".\"extra-lib-dirs\" += [\"$SDL2/lib/\"]" stack.yaml | |
yq --inplace ".\"extra-include-dirs\" += [\"$SDL2/include/\"]" stack.yaml | |
- name: Install system dependencies macOS | |
if: matrix.os == 'macOS-latest' | |
shell: bash | |
run: | | |
brew install pkg-config sdl2 | |
- name: Prepare Vulkan SDK | |
uses: humbletim/[email protected] | |
with: | |
vulkan-query-version: latest | |
vulkan-components: Vulkan-Headers, Vulkan-Loader, Glslang | |
vulkan-use-cache: true | |
- name: Inform Stack about Vulkan | |
shell: bash | |
run: | | |
yq --inplace ".\"extra-lib-dirs\" += [\"$VULKAN_SDK/lib/\"]" stack.yaml | |
yq --inplace ".\"extra-include-dirs\" += [\"$VULKAN_SDK/include/\"]" stack.yaml | |
printf "%s\n" "$VULKAN_SDK/bin" >> "$GITHUB_PATH" | |
if uname -s | grep -i mingw; then sep=';'; else sep=':'; fi | |
printf "%s\n" "PKG_CONFIG_PATH=${PKG_CONFIG_PATH:+${PKG_CONFIG_PATH}${sep}}$VULKAN_SDK/lib/pkgconfig" >> "$GITHUB_ENV" | |
# until this is fixed https://github.com/haskell/cabal/issues/7339 | |
printf "%s\n" "DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH:+${DYLD_LIBRARY_PATH}${sep}}$VULKAN_SDK/lib" >> "$GITHUB_ENV" | |
- name: Remove openxr | |
run: | | |
sed -ibak '/openxr/d' stack.yaml | |
- name: Install dependencies | |
shell: bash | |
run: stack build $ARGS --test --bench --only-dependencies | |
env: | |
ARGS: ${{ matrix.stack-args }} | |
- name: Build | |
shell: bash | |
run: stack build $ARGS | |
env: | |
ARGS: ${{ matrix.stack-args }} | |
- name: Build documentation | |
shell: bash | |
run: stack haddock $ARGS | |
env: | |
ARGS: ${{ matrix.stack-args }} | |
nix: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
ghc: ['"ghc810"', '"ghc90"', '"ghc92"'] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
- uses: cachix/install-nix-action@V27 | |
with: | |
nix_path: nixpkgs=channel:nixos-unstable | |
- uses: cachix/cachix-action@v14 | |
with: | |
name: vulkan-haskell | |
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}' | |
- run: nix-build --arg compiler '${{ matrix.ghc }}' -A vulkan | |
- run: nix-build --arg compiler '${{ matrix.ghc }}' -A VulkanMemoryAllocator | |
- run: nix-build --arg compiler '${{ matrix.ghc }}' -A vulkan-utils | |
- run: nix-build --arg compiler '${{ matrix.ghc }}' -A openxr | |
- run: nix-build --arg compiler '${{ matrix.ghc }}' ./nix/haskell-packages.nix --arg openxrNoVulkan true -A openxr | |
- run: nix-build --arg compiler '${{ matrix.ghc }}' -A vulkan-examples | |
- run: nix-build --arg compiler '${{ matrix.ghc }}' -j1 nix/release.nix | |
- run: nix-build --arg compiler '${{ matrix.ghc }}' nix/release.nix -A docs | |
- run: nix-build --arg compiler '${{ matrix.ghc }}' nix/release.nix -A docs-combined | |
- run: XDG_DATA_DIRS=$(mktemp -d) nix-shell --arg compiler '${{ matrix.ghc }}' examples --run 'ghc-pkg list' | |
nix-sdist: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
- uses: cachix/install-nix-action@V27 | |
with: | |
nix_path: nixpkgs=channel:nixos-unstable | |
- uses: cachix/cachix-action@v14 | |
with: | |
name: vulkan-haskell | |
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}' | |
- run: nix-build nix/release.nix -j1 -A sdistTest | |
nix-generator: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
- uses: cachix/install-nix-action@V27 | |
with: | |
nix_path: nixpkgs=channel:nixos-unstable | |
- uses: cachix/cachix-action@v14 | |
with: | |
name: vulkan-haskell | |
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}' | |
- run: nix-build -A generate-new | |
nix-shell-profiling: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
- uses: cachix/install-nix-action@V27 | |
with: | |
nix_path: nixpkgs=channel:nixos-unstable | |
- uses: cachix/cachix-action@v14 | |
with: | |
name: vulkan-haskell | |
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}' | |
- run: XDG_DATA_DIRS=$(mktemp -d) nix-shell examples --arg buildProfiling true --run 'ghc-pkg list' | |
shellcheck: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install shellcheck | |
run: | | |
sudo apt-get install fd-find | |
- name: Check scripts with shellcheck | |
run: | | |
fdfind .sh$ . \ | |
--exclude VulkanMemoryAllocator/VulkanMemoryAllocator \ | |
--exclude generate-new/Vulkan-Docs \ | |
--exclude generate-new/OpenXR-Docs \ | |
--exec shellcheck |