Repository navigation
Upload Android APK and iOS library as CI artifacts #17
Workflow file for this run
This file contains hidden or 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
| 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 | |
| - name: Upload Android APK | |
| 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 | |
| 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 }} |