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

haskell.nix integration #615

Draft
wants to merge 26 commits into
base: main
Choose a base branch
from
Draft
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
85 changes: 43 additions & 42 deletions .github/workflows/artifacts-native.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,50 +13,51 @@ jobs:
strategy:
matrix:
stack:
- "2.5.1"
- "2.9.1"
ghc:
- "8.10.4"
- "8.10.7"
os:
- macos-10.15
- ubuntu-18.04
- macos-11
- macos-12
- ubuntu-20.04
- ubuntu-22.04

steps:
- uses: actions/checkout@v2
name: 📤 Checkout
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/main'

- uses: haskell/actions/setup@v1
name: 🧱 Set up Haskell Stack
with:
ghc-version: ${{ matrix.ghc }}
stack-version: ${{ matrix.stack }}

- uses: actions/cache@v2
name: 🗄️ Cache ~/.stack
with:
path: ~/.stack
key: ${{ matrix.os }}-${{ matrix.ghc }}-stack-native-4

- uses: ./.github/actions/secp256k1
name: 📦 Build and install libsecp256k1

- name: 📦 Install dependencies
run: |
stack build --no-nix --only-dependencies

- name: 🏗️ Build
run: |
stack build --no-nix

- name: 🏺 Upload CLI Artifact
uses: actions/upload-artifact@v2
with:
name: fission-cli-${{ matrix.os }}
path: ./.stack-work/**/bin/fission

- name: 🏺 Upload Server Artifact
uses: actions/upload-artifact@v2
with:
name: fission-server-${{ matrix.os }}
path: ./.stack-work/**/bin/fission-server
- uses: actions/checkout@v3
name: 📤 Checkout
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/main'

- uses: haskell/actions/setup@v2
name: 🧱 Set up Haskell Stack
with:
ghc-version: ${{ matrix.ghc }}
stack-version: ${{ matrix.stack }}

- uses: actions/cache@v3
name: 🗄️ Cache ~/.stack
with:
path: ~/.stack
key: ${{ matrix.os }}-${{ matrix.ghc }}-stack-native-4

- uses: ./.github/actions/secp256k1
name: 📦 Build and install libsecp256k1

- name: 📦 Install dependencies
run: |
stack build --no-nix --only-dependencies

- name: 🏗️ Build
run: |
stack build --no-nix

- name: 🏺 Upload CLI Artifact
uses: actions/upload-artifact@v2
with:
name: fission-cli-${{ matrix.os }}
path: ./.stack-work/**/bin/fission

- name: 🏺 Upload Server Artifact
uses: actions/upload-artifact@v2
with:
name: fission-server-${{ matrix.os }}
path: ./.stack-work/**/bin/fission-server
49 changes: 0 additions & 49 deletions .github/workflows/artifacts-nix.yaml

This file was deleted.

38 changes: 0 additions & 38 deletions .github/workflows/cachix.yaml

This file was deleted.

45 changes: 23 additions & 22 deletions .github/workflows/ci-native.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,35 @@ jobs:
strategy:
matrix:
stack:
- "2.5.1"
- "2.9.1"
ghc:
- "8.10.4"
- "8.10.7"
os:
- macos-10.15
- ubuntu-18.04
- macos-11
- macos-12
- ubuntu-20.04
- ubuntu-22.04

steps:
- uses: actions/checkout@v2
name: 📤 Checkout
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/main'
- uses: actions/checkout@v3
name: 📤 Checkout
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/main'

- uses: ./.github/actions/secp256k1
name: 📦 Build and install libsecp256k1
- uses: ./.github/actions/secp256k1
name: 📦 Build and install libsecp256k1

- uses: haskell/actions/setup@v1
name: 🧱 Set up Haskell Stack
with:
ghc-version: ${{ matrix.ghc }}
stack-version: ${{ matrix.stack }}
- uses: haskell/actions/setup@v2
name: 🧱 Set up Haskell Stack
with:
ghc-version: ${{ matrix.ghc }}
stack-version: ${{ matrix.stack }}

- uses: actions/cache@v2
name: 🗄️ Cache ~/.stack
with:
path: ~/.stack
key: ${{ matrix.os }}-${{ matrix.ghc }}-stack-ci-2
- uses: actions/cache@v3
name: 🗄️ Cache ~/.stack
with:
path: ~/.stack
key: ${{ matrix.os }}-${{ matrix.ghc }}-stack-ci-2

- name: 🧪 Test
run: |
stack test --no-nix
- name: 🧪 Test
run: |
stack test --no-nix
29 changes: 11 additions & 18 deletions .github/workflows/ci-nix.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 🧪 Tests (Nix)
name: ❄️ Nix Build

# Trigger the workflow on push or pull request, but only for the main branch
on:
Expand All @@ -13,25 +13,18 @@ jobs:
strategy:
matrix:
os:
- macos-latest
- ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
name: 📤 Checkout
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/main'

- uses: cachix/install-nix-action@v16
name: ❄️ Set up Nix
- uses: DeterminateSystems/nix-installer-action@main
name: ❄️ Set up Nix
- uses: cachix/cachix-action@v12
name: 🧰 Cachix
with:
nix_path: nixpkgs=channel:nixos-unstable

- uses: actions/cache@v2
name: 🗄️ Cache ~/.stack
with:
path: ~/.stack
key: ${{ matrix.os }}-stack-nix-${{ hashFiles('stack.yaml.lock') }}

- name: 🧪 Test
name: fission-codes
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: 👷 Build
run: |
nix-shell --command quality
nix build .#fission-cli --accept-flake-config
nix build .#fission-server --accept-flake-config
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -591,3 +591,5 @@ MigrationBackup/
fission-web-server/data/
fission-web-server/.env
.direnv/

!.stack-to-nix.cache
Loading
Loading