tricu

An interpreted language for exploring Tree Calculus
Log | Files | Refs | README | LICENSE

commit 56f0c2860a768820fca471e747d5a24bbc994dab
parent aac10d031dbe69a6e9397b2b6dc6f87e58f37bec
Author: James Eversole <james@eversole.co>
Date:   Tue, 21 Jan 2025 13:29:52 -0600

CI/CD for tests and builds (broken caching)

Diffstat:
A.gitea/workflows/test-and-build.yml | 86+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 86 insertions(+), 0 deletions(-)

diff --git a/.gitea/workflows/test-and-build.yml b/.gitea/workflows/test-and-build.yml @@ -0,0 +1,86 @@ +name: Test and Build + +on: + push: + branches: + - main + pull_request: + types: + - opened + - synchronize + +jobs: + test: + container: + image: docker.matri.cx/nix-runner:latest + credentials: + username: ${{ secrets.REGISTRY_USERNAME }} + password: ${{ secrets.REGISTRY_PASSWORD }} + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up cache for Cabal + uses: actions/cache@v4 + with: + path: | + ~/.cabal + ~/.ghc + key: cabal-${{ runner.os }}-${{ hashFiles('tricu.cabal') }} + restore-keys: | + cabal-${{ runner.os }}- + + - name: Set up cache for Nix + uses: actions/cache@v4 + with: + path: | + /nix/store + /nix/var/nix/cache + key: nix-${{ runner.os }}-${{ hashFiles('flake.lock') }} + restore-keys: | + nix-${{ runner.os }}- + + - name: Initialize Cabal and update package list + run: | + nix develop --command cabal update + + - name: Install dependencies and run tests + run: | + nix develop --command cabal test + + build: + needs: test + container: + image: docker.matri.cx/nix-runner:latest + credentials: + username: ${{ secrets.REGISTRY_USERNAME }} + password: ${{ secrets.REGISTRY_PASSWORD }} + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up cache for Cabal + uses: actions/cache@v4 + with: + path: | + ~/.cabal + ~/.ghc + key: cabal-${{ runner.os }}-${{ hashFiles('tricu.cabal') }} + restore-keys: | + cabal-${{ runner.os }}- + + - name: Set up cache for Nix + uses: actions/cache@v4 + with: + path: | + /nix/store + /nix/var/nix/cache + key: nix-${{ runner.os }}-${{ hashFiles('flake.lock') }} + restore-keys: | + nix-${{ runner.os }}- + + - name: Build binary + run: | + nix build + ls -alh ./result/bin/tricu +