Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update haskell dependencies (Nix) #126

Closed
wants to merge 21 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/cachix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Push flake to cachix

on:
push:
branches: [main, develop]
paths:
- "**/*.nix"
- "flake.lock"
- "**/*.cabal"

jobs:
push-to-cachix:
name: Push flake to cachix
strategy:
matrix:
os: [ubuntu-22.04, macos-12]
runs-on: ${{ matrix.os }}
steps:
- name: 📥 Checkout repository
uses: actions/checkout@v3

- name: ❄️ Install Nix
uses: nixbuild/nix-quick-install-action@v25
with:
nix_conf: |
substituters = https://cache.nixos.org/ https://cache.iog.io https://nix-community.cachix.org https://miso-haskell.cachix.org https://rzk-lang.cachix.org
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= miso-haskell.cachix.org-1:6N2DooyFlZOHUfJtAx1Q09H0P5XXYzoxxQYiwn6W1e8= rzk-lang.cachix.org-1:hz9Ld3hYNWSM7cswW/28Dt4ABgGdK0CfBDx/MrciZW8=
keep-outputs = true

- name: 👝 Restore and Cache Nix store
uses: nix-community/cache-nix-action@v4
with:
key: ${{ runner.os }}-cachix-${{ hashfiles('flake*', '.github/workflows/cachix.yml', '**/*.cabal') }}
restore-keys: |
${{ runner.os }}-cachix-${{ hashfiles('flake*', '.github/workflows/cachix.yml', '**/*.cabal') }}
${{ runner.os }}-cachix-
${{ runner.os }}-nix-
gc-linux: true
gc-max-store-size-linux: 13000000000
purge: true
purge-created-max-age: 1209600

- name: 🔨 Push flake to cachix
env:
CACHIX_CACHE: ${{ vars.CACHIX_CACHE }}
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
run: nix run .#pushToCachix

- name: 🔨 Save flake from garbage collection
run: nix run .#save-flake
38 changes: 15 additions & 23 deletions .github/workflows/ghcjs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,16 @@ on:
tags: [v*]
paths:
- .github/workflows/ghcjs.yml
- rzk/**
- rzk-js/**
- rzk-playground/**
- stack.yaml
- rzk*/**
- "**/*.nix"
- "**/*.lock"
pull_request:
branches: [develop]
paths:
- .github/workflows/ghcjs.yml
- rzk/**
- rzk-js/**
- rzk-playground/**
- stack.yaml
- rzk*/**
- "**/*.nix"
- "**/*.lock"

workflow_dispatch: # allow triggering this workflow manually

Expand All @@ -38,50 +34,43 @@ jobs:
uses: nixbuild/nix-quick-install-action@v25
with:
nix_conf: |
substituters = https://cache.nixos.org/ https://cache.iog.io https://nix-community.cachix.org https://miso-haskell.cachix.org
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= miso-haskell.cachix.org-1:6N2DooyFlZOHUfJtAx1Q09H0P5XXYzoxxQYiwn6W1e8=
substituters = https://cache.nixos.org/ https://cache.iog.io https://nix-community.cachix.org https://miso-haskell.cachix.org https://rzk-lang.cachix.org
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= miso-haskell.cachix.org-1:6N2DooyFlZOHUfJtAx1Q09H0P5XXYzoxxQYiwn6W1e8= rzk-lang.cachix.org-1:hz9Ld3hYNWSM7cswW/28Dt4ABgGdK0CfBDx/MrciZW8=
keep-outputs = true

- name: 👝 Restore and Cache Nix store
uses: nix-community/cache-nix-action@v4
with:
key: ${{ runner.os }}-nix-${{ hashfiles('./flake.nix', './flake.lock', '.github/workflows/ghcjs.yml', './rzk/rzk.cabal') }}
key: ${{ runner.os }}-playground-ghcjs-${{ hashfiles('flake*', '**/*.nix', '.github/workflows/ghcjs.yml', '**/*.cabal') }}
restore-keys: |
${{ runner.os }}-nix-${{ hashfiles('./flake.nix', './flake.lock', '.github/workflows/ghcjs.yml', './rzk/rzk.cabal') }}
${{ runner.os }}-playground-ghcjs-
${{ runner.os }}-nix-
Copy link
Contributor Author

@deemp deemp Oct 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving this -nix- restore key for now to populate new cache.

gc-linux: true
gc-max-store-size-linux: 7000000000
gc-max-store-size-linux: 12000000000
purge: true
purge-created-max-age: 1209600

- name: 👝 Restore and Cache NextJS cache
- name: 👝 Restore and Cache NodeJS dependencies
uses: actions/cache@v3
with:
key: ${{ runner.os }}-next-${{ hashFiles('**/package-lock.json') }}
key: ${{ runner.os }}-playground-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-playground-node-
${{ runner.os }}-next-
path: |
~/.npm
rzk-playground/.next/cache

- name: 🔨 Remove lexer and parser generator files
run: |
rm -f rzk/src/Language/Rzk/Syntax/Lex.x
rm -f rzk/src/Language/Rzk/Syntax/Par.y

# Uncomment to debug this job
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3

- name: 🔨 Build Playground
env:
ASSET_URL: /${{ github.event.repository.name }}/${{ github.ref_name }}/playground
run: |
nix run .#release-rzk-playground

- name: 🔨 Save flake from garbage collection
run: nix run .#save-flake

- name: '🚀 Publish JS "binaries" (${{ github.ref_name }})'
if: ${{ github.ref_name != 'main' && github.event_name == 'push' }}
uses: JamesIves/github-pages-deploy-action@v4
Expand All @@ -101,3 +90,6 @@ jobs:
target-folder: playground
clean: false
single-commit: true

- name: 🔨 Save flake from garbage collection
run: nix run .#save-flake
Loading