Skip to content

Merge pull request #5 from jappeace-sloth/ci-upload-artifacts #20

Merge pull request #5 from jappeace-sloth/ci-upload-artifacts

Merge pull request #5 from jappeace-sloth/ci-upload-artifacts #20

Workflow file for this run

on:
pull_request:
push:
branches:
- master
permissions:
actions: write
jobs:
nix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Local cache
uses: actions/cache@v4
with:
path: /nix/store
key: "${{ runner.os }}-nix-cache"
- uses: cachix/install-nix-action@v31
with:
nix_path: nixpkgs=channel:nixos-unstable
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- uses: cachix/cachix-action@v15
with:
name: jappie
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- run: nix-build
- run: nix-shell --run "echo OK"
- name: Cancel workflow on failure
if: failure()
continue-on-error: true
run: gh run cancel ${{ github.run_id }}
env:
GH_TOKEN: ${{ github.token }}
android:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Local cache
uses: actions/cache@v4
with:
path: /nix/store
key: "${{ runner.os }}-nix-android-cache"
- uses: cachix/install-nix-action@v31
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- uses: cachix/cachix-action@v15
with:
name: jappie
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: nix-build nix/android.nix
- run: nix-build nix/apk.nix -o result-apk
if: github.ref == 'refs/heads/master'
- name: Upload Android APK
if: github.ref == 'refs/heads/master'
uses: actions/upload-artifact@v4
with:
name: haskell-mobile-android
path: result-apk/haskell-mobile.apk
- name: Cancel workflow on failure
if: failure()
continue-on-error: true
run: gh run cancel ${{ github.run_id }}
env:
GH_TOKEN: ${{ github.token }}
ios:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Local cache
uses: actions/cache@v4
with:
path: /nix/store
key: "${{ runner.os }}-nix-ios-cache"
- uses: cachix/install-nix-action@v31
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- uses: cachix/cachix-action@v15
with:
name: jappie
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: nix-build nix/ios.nix
- name: Upload iOS library
if: github.ref == 'refs/heads/master'
uses: actions/upload-artifact@v4
with:
name: haskell-mobile-ios
path: |
result/lib/libHaskellMobile.a
result/include/HaskellMobile.h
- name: Cancel workflow on failure
if: failure()
continue-on-error: true
run: gh run cancel ${{ github.run_id }}
env:
GH_TOKEN: ${{ github.token }}
cabal:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
ghc:
- '9.12'
- '9.10'
- '9.8'
- '9.6'
os: [ubuntu-latest, macOS-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- uses: haskell-actions/setup@v2
with:
ghc-version: ${{ matrix.ghc }}
- name: Cabal cache
uses: actions/cache@v4
env:
cache-name: cache-cabal
with:
path: ~/.cabal
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
- name: Cabal update
run: cabal update
- name: Build using cabal
run: cabal build all
- name: Test
run: cabal test all
- name: Cancel workflow on failure
if: failure()
continue-on-error: true
run: gh run cancel ${{ github.run_id }}
env:
GH_TOKEN: ${{ github.token }}