This commit is contained in:
Robin Appelman 2025-06-09 18:18:19 +02:00
commit 90a30ef175
5 changed files with 50 additions and 117 deletions

40
.forgejo/workflows/ci.yml Normal file
View file

@ -0,0 +1,40 @@
name: "CI"
on:
pull_request:
push:
jobs:
checks:
runs-on: nix
steps:
- uses: actions/checkout@v4
- uses: https://codeberg.org/icewind/attic-action@v1
with:
name: link
instance: https://cache.icewind.link
authToken: "${{ secrets.ATTIC_TOKEN }}"
- run: nix flake check --keep-going
client-checks:
runs-on: nix
steps:
- uses: actions/checkout@v4
- uses: https://codeberg.org/icewind/attic-action@v1
with:
name: link
instance: https://cache.icewind.link
authToken: "${{ secrets.ATTIC_TOKEN }}"
- run: nix flake check ./client --keep-going
semver:
runs-on: nix
needs: client-checks
steps:
- uses: actions/checkout@v4
- uses: https://codeberg.org/icewind/attic-action@v1
with:
name: ci
instance: https://cache.icewind.me
authToken: "${{ secrets.ATTIC_TOKEN }}"
- run: |
cd client
nix run .#semver-checks

View file

@ -1,69 +0,0 @@
name: CI
on:
pull_request:
push:
branches:
- main
- master
permissions:
contents: read
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v20
- uses: icewind1991/attic-action@v1
with:
name: ci
instance: https://cache.icewind.me
authToken: "${{ secrets.ATTIC_TOKEN }}"
- run: nix build .#check
clippy:
runs-on: ubuntu-latest
needs: check
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v20
- uses: icewind1991/attic-action@v1
with:
name: ci
instance: https://cache.icewind.me
authToken: "${{ secrets.ATTIC_TOKEN }}"
- run: nix build .#clippy
matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v20
- id: set-matrix
run:
echo "matrix=$(nix eval --json ".#matrix.x86_64-linux")" | tee
$GITHUB_OUTPUT
build:
runs-on: ubuntu-latest
needs: [check, matrix]
strategy:
fail-fast: false
matrix: ${{fromJson(needs.matrix.outputs.matrix)}}
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v20
- uses: icewind1991/attic-action@v1
with:
name: ci
instance: https://cache.icewind.me
authToken: "${{ secrets.ATTIC_TOKEN }}"
- run: nix build .#${{ matrix.target }}
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.artifact_name }}-${{ matrix.target }}
path: result/bin/${{ matrix.artifact_name }}

View file

@ -1,40 +0,0 @@
name: Release
on:
release:
types: [created]
jobs:
matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v20
- id: set-matrix
run:
echo "matrix=$(nix eval --json ".#releaseMatrix.x86_64-linux")" | tee
$GITHUB_OUTPUT
build:
runs-on: ubuntu-latest
needs: matrix
strategy:
matrix: ${{fromJson(needs.matrix.outputs.matrix)}}
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v20
- uses: icewind1991/attic-action@v1
with:
name: ci
instance: https://cache.icewind.me
authToken: "${{ secrets.ATTIC_TOKEN }}"
- run: nix build .#${{ matrix.target }}
- name: Upload binary to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: result/bin/${{ matrix.artifact_name }}
asset_name: ${{ matrix.asset_name }}
tag: ${{ github.ref }}

15
client/flake.lock generated
View file

@ -44,14 +44,17 @@
"rust-overlay": "rust-overlay" "rust-overlay": "rust-overlay"
}, },
"locked": { "locked": {
"lastModified": 1749479717, "lastModified": 1749481047,
"narHash": "sha256-A/QfxOzt5cOLiz/Fn0xTQ3OGaJkIgq6KwnBv7AXRoG4=", "narHash": "sha256-5VnLJdD91sTcJNvCaxH5r46Yl+RmyCcLftScxkEqP3k=",
"path": "/home/robin/Projects/mill-scale", "ref": "refs/heads/main",
"type": "path" "rev": "642a7528ddea74bbe649913c5c3bb630eea02ecb",
"revCount": 52,
"type": "git",
"url": "https://codeberg.org/icewind/mill-scale"
}, },
"original": { "original": {
"path": "/home/robin/Projects/mill-scale", "type": "git",
"type": "path" "url": "https://codeberg.org/icewind/mill-scale"
} }
}, },
"nixpkgs": { "nixpkgs": {

View file

@ -6,8 +6,7 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
mill-scale = { mill-scale = {
# url = "git+https://codeberg.org/icewind/mill-scale"; url = "git+https://codeberg.org/icewind/mill-scale";
url = "path:/home/robin/Projects/mill-scale";
inputs.flakelight.follows = "flakelight"; inputs.flakelight.follows = "flakelight";
}; };
}; };