Skip to content

CI

CI #196

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches:
- '*'
schedule:
- cron: '0 0 * * 0' # weekly
jobs:
nix:
name: Build via Nix
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v25
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- run: nix develop --command cabal build
# TODO: also run tests
- run: |
nix build .#ldbcollector-untested
nix-store --export $(nix-store --query --requisites ./result) > ldbcollector.nar
- uses: actions/upload-artifact@v4
with:
name: ldbcollector.nar
path: ldbcollector.nar
compression-level: 0
retention-days: 90
- run: nix flake check
docker:
name: Build an Docker image via Nix and push
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/upload-artifact@v4
with:
name: data
path: data
compression-level: 6
retention-days: 90
- uses: cachix/install-nix-action@v25
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- name: 'Login to GitHub Container Registry'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}
- name: 'Build and push Image'
run: |
./nix-docker-build-and-load.sh
tag="$(./nix-docker-build-and-load.sh echo-tag)"
podman tag "$tag" "ghcr.io/maxhbr/ldbcollector:latest"
podman push "ghcr.io/maxhbr/ldbcollector:latest"
- uses: actions/upload-artifact@v4
with:
name: ldbcollector.tar.gz
path: ldbcollector.tar.gz
compression-level: 0
retention-days: 90
- name: 'Add data and push Image'
run: |
./.github/workflows/docker-add-data-to-img.sh "$(readlink -f data)" "ghcr.io/maxhbr/ldbcollector:latest" "ghcr.io/maxhbr/ldbcollector-with-data:latest"
podman push "ghcr.io/maxhbr/ldbcollector-with-data:latest"
podman save -o ldbcollector-with-data.tar.gz "ghcr.io/maxhbr/ldbcollector-with-data:latest"
- uses: actions/upload-artifact@v4
with:
name: ldbcollector-with-data.tar.gz
path: ldbcollector-with-data.tar.gz
compression-level: 0
retention-days: 30
# cabal:
# name: Build via Cabal
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: submodule checkout (partially complete)
# run: |
# sed -i 's/[email protected]:/https:\/\/github.com\//g' .gitmodules
# sed -i 's/[email protected]:/https:\/\/gitlab.com\//g' .gitmodules
# git submodule sync --recursive || true
# git submodule update --init --recursive || true
# - uses: haskell/actions/setup@v2
# with:
# ghc-version: '9.4.8'
# cabal-version: 'latest'
# enable-stack: false
# - run: cabal update
# - run: cabal build
# # - run: cabal test
# # - run: time cabal run -- write BSD-3-Clause
# # - uses: actions/upload-artifact@v2
# # with:
# # name: out
# # path: _out