1
0
Fork 0
mirror of https://github.com/malob/prefmanager.git synced 2024-12-14 11:57:49 +00:00

Merge workflows

This commit is contained in:
Malo Bourgon 2023-06-28 17:27:16 -07:00
parent 939cec996d
commit b5205879c1
2 changed files with 72 additions and 82 deletions

View file

@ -1,39 +1,82 @@
name: "Build and Cache" name: CI
on: on:
pull_request: pull_request:
push: push:
jobs: jobs:
build-and-cache: matrix:
runs-on: macos-latest name: Generate matrix
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.gen-matrix.outputs.matrix }}
steps: steps:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Install Nix - name: Install Nix
uses: cachix/install-nix-action@v22 uses: DeterminateSystems/nix-installer-action@v4
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: Setup Cachix - name: Genrate matrix
uses: cachix/cachix-action@v12 id: gen-matrix
with: run: |
name: malo echo "matrix=$(nix eval --impure --json --expr '(import ./constants.nix).ghcVersions')" \
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}' >> $GITHUB_OUTPUT
- name: Nix Flakes nix-build-packages:
run: | needs: matrix
nix -L build . runs-on: macos-latest
nix -L run . -- --help
nix -L develop .
- name: Nix Legacy strategy:
run: | fail-fast: false
nix-build default.nix matrix:
nix-shell shell.nix ghc: ${{ fromJson(needs.matrix.outputs.matrix) }}
- name: Stack name: Nix build (${{ matrix.ghc }})
run: |
stack build steps:
stack purge - name: Checkout repo
nix-shell shell.nix --run 'stack --nix build' uses: actions/checkout@v3
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v4
- name: Setup cache
uses: DeterminateSystems/magic-nix-cache-action@main
- name: Build and test
run: |
NAME=$(nix eval --impure --raw --expr '(import ./constants.nix).name')-${{ matrix.ghc }}
nix -L build .#$NAME
nix run .#$NAME -- domains
stack-build:
name: Stack build
runs-on: macos-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Build and test
run: |
stack run -- domains
stack-build-nix:
name: Stack build w/ Nix
runs-on: macos-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v4
- name: Setup cache
uses: DeterminateSystems/magic-nix-cache-action@main
- name: Build and test
run: |
stack run --nix -- domains

View file

@ -1,53 +0,0 @@
name: Nix CI
on:
pull_request:
push:
jobs:
matrix:
name: Generate matrix
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.gen-matrix.outputs.matrix }}
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v4
- name: Genrate matrix
id: gen-matrix
run: |
echo "matrix=$(nix eval --impure --json --expr '(import ./constants.nix).ghcVersions')" \
>> $GITHUB_OUTPUT
build:
needs: matrix
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
ghc: ${{ fromJson(needs.matrix.outputs.matrix) }}
name: Nix build (${{ matrix.ghc }})
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v4
- name: Setup cache
uses: DeterminateSystems/magic-nix-cache-action@main
- name: Build and test
run: |
NAME=$(nix eval --impure --raw --expr '(import ./constants.nix).name')-${{ matrix.ghc }}
nix -L build .#$NAME
nix run .#$NAME -- domains