Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ipetkov/crane
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.5.1
Choose a base ref
...
head repository: ipetkov/crane
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing 537 changed files with 34,073 additions and 2,844 deletions.
4 changes: 1 addition & 3 deletions .envrc
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
watch_file flake.nix flake.lock

eval "$(nix print-dev-env)"
use flake
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# nixpkgs-fmt update
9eb8357f53cc2bff06b0727e6560f6a8fd6759b0
# run nixpkgs-fmt
35fd8fcbb0974fadac39d30e0991f978c646d909
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''
---

**Describe the bug**
<!--
Please describe the error and provide error logs as appropriate.
If something is confusing or unclear, please describe what you would have expected to happen
Otherwise, if you need help debugging a broken build configuration, consider
opening a discussion: https://github.com/ipetkov/crane/discussions
-->

**Reproduction**
<!-- Please provide a(n ideally minimal) flake that reproduces the issue, and specify which output needs to be built that shows the error -->
4 changes: 4 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
contact_links:
- name: Question
url: https://github.com/ipetkov/crane/discussions
about: Questions about Crane or requests to debug a failing build should be posted as a GitHub discussion.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
15 changes: 15 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## Motivation
<!--
Thank you for your contribution! Please add a brief description below about the change and what is the motivation
behind it.
-->

## Checklist
<!--
Note: this list does not have to be complete to submit a contribution!
Fill out what you can and feel free to ask for help with anything
-->
- [ ] added tests to verify new behavior
- [ ] added an example template or updated an existing one
- [ ] updated `docs/API.md` (or general documentation) with changes
- [ ] updated `CHANGELOG.md`
38 changes: 38 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: "pages"
on:
push:
branches:
- "master"

permissions:
contents: read

jobs:
deploy:
runs-on: ubuntu-latest
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v30
- uses: cachix/cachix-action@v15
with:
name: crane
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: mdbook build
run: |
mkdir output
nix build --accept-flake-config .#book --out-link result --print-build-logs
rsync -r -L ./result/ ./output
- name: git push
working-directory: output
run: |
git init
git config user.name "GitHub Actions"
git config user.email "github-actions-bot@users.noreply.github.com"
git branch -M gh-pages
git add .
git commit -m "Deploying site"
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
echo "${{ secrets.DEPLOY_KEY }}" | tr -d '\r' | ssh-add -
git push --force "git@github.com:${GITHUB_REPOSITORY}.git" gh-pages
18 changes: 18 additions & 0 deletions .github/workflows/publish-flakehub.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: publish flakehub
on:
workflow_dispatch: # for allowing manual triggers of the workflow
push:
tags:
- "v*.*.*"
jobs:
publish-flakehub:
runs-on: "ubuntu-latest"
permissions:
id-token: "write"
contents: "read"
steps:
- uses: "actions/checkout@v4"
- uses: "DeterminateSystems/nix-installer-action@main"
- uses: "DeterminateSystems/flakehub-push@main"
with:
visibility: "public"
126 changes: 103 additions & 23 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Test"
name: "Run test suite"
on:
pull_request:
types: [opened, synchronize, reopened]
@@ -7,41 +7,121 @@ on:
- 'master'
- 'ci*' # Allow testing CI fixes without opening a PR

permissions:
contents: read

jobs:
tests-pass:
name: all systems go
runs-on: ubuntu-latest
if: ${{ always() && contains(needs.*.result, 'failure') }}
steps:
- run: exit 1
needs:
- lints
- examples-darwin
- examples-linux
- tests

tests:
strategy:
# Allow other jobs to finish building and cache properly before bailing
fail-fast: false
matrix:
include:
- os: ubuntu-latest
# Latest and greatest release of Nix
install_url: https://nixos.org/nix/install
- os: ubuntu-latest
# The 22.05 branch ships with Nix 2.8.1
install_url: https://releases.nixos.org/nix/nix-2.8.1/install
nixpkgs-override: "--override-input nixpkgs github:NixOS/nixpkgs/release-22.05"

runs-on: ${{ matrix.os }}
- install_url: https://nixos.org/nix/install
# The 24.11 branch ships with Nix 2.24.10
- install_url: https://releases.nixos.org/nix/nix-2.24.10/install
nixpkgs-override: "--override-input nixpkgs $(./ci/ref-from-lock.sh ./test#nixpkgs-latest-release)"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v17
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v30
with:
install_url: ${{ matrix.install_url }}
- uses: cachix/cachix-action@v10
- uses: cachix/cachix-action@v15
with:
name: crane
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: flake checks
run: nix flake check --keep-going --print-build-logs ${{ matrix.nixpkgs-override }}
authToken: ${{ github.ref == 'refs/heads/master' && secrets.CACHIX_AUTH_TOKEN || '' }}
- run: nix flake check -L .#
- run: nix develop --accept-flake-config --command ./ci/fast-flake-check.sh ./test ${{ matrix.nixpkgs-override }}
- name: extra tests
run: nix develop ${{ matrix.nixpkgs-override }} --command ./extra-tests/test.sh
run: nix develop --accept-flake-config --command ./extra-tests/test.sh

examples-linux:
strategy:
# Allow other jobs to finish building and cache properly before bailing
fail-fast: false
matrix:
example:
- alt-registry
- build-std
- cross-musl
- cross-rust-overlay
- cross-windows
- custom-toolchain
- end-to-end-testing
- quick-start
- quick-start-simple
- quick-start-workspace
- sqlx
- trunk-workspace
- trunk
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v30
- uses: cachix/cachix-action@v15
with:
name: crane
authToken: ${{ github.ref == 'refs/heads/master' && secrets.CACHIX_AUTH_TOKEN || '' }}
- name: validate examples
# Nix won't write a lockfile when --override-input is used (which is good because it will
# complain that the lock file is .gitignored), but nix-eval-jobs doesn't, so we'll have to
# "opt-out" of our lockfile .gitignore
run: |
for f in $(find examples -maxdepth 1 -mindepth 1 -type d); do
pushd "${f}"
echo "validating ${f}"
nix flake check --print-build-logs --override-input crane ../.. ${{ matrix.nixpkgs-override }}
nix run --override-input crane ../.. ${{ matrix.nixpkgs-override }}
popd
done
rm ./examples/.gitignore
nix develop .# --accept-flake-config --command ./ci/check-example.sh ./examples/${{ matrix.example }} "./test#nixpkgs"
examples-darwin:
strategy:
# Allow other jobs to finish building and cache properly before bailing
fail-fast: false
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v30
- uses: cachix/cachix-action@v15
with:
name: crane
authToken: ${{ github.ref == 'refs/heads/master' && secrets.CACHIX_AUTH_TOKEN || '' }}
- name: validate examples
# Nix won't write a lockfile when --override-input is used (which is good because it will
# complain that the lock file is .gitignored), but nix-eval-jobs doesn't, so we'll have to
# "opt-out" of our lockfile .gitignore
run: |
rm ./examples/.gitignore
nix develop .# --accept-flake-config --command bash -c '
set -euo pipefail
for f in $(find ./examples -maxdepth 1 -mindepth 1 -type d -not -name build-std -not -name cross-musl -not -name cross-rust-overlay | sort -u); do
# NB: nix-eval-jobs appears broken on darwin atm?
# /nix/store/2419grj384lg233jqchamm73il9iyjxg-libcxx-16.0.6-dev/include/c++/v1/optional:962: assertion this->has_value() failed: optional operator* called on a disengaged valueerror: error: while checking worker process, evaluation worker got killed by signal 6 (Abort trap: 6)
nix flake check \
--accept-flake-config \
--print-build-logs \
--reference-lock-file ./test/flake.lock \
--override-input crane ./. \
"${f}"
done
'
lints:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v30
- name: check formatting
run: nix fmt --accept-flake-config -- --check .
- name: check for dead code
run: nix develop .# --command deadnix .
39 changes: 39 additions & 0 deletions .github/workflows/update-flake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Update internal flake dependencies

on:
workflow_dispatch: # for allowing manual triggers of the workflow
schedule:
- cron: '37 16 3,18 * *'

permissions:
contents: read

jobs:
update-and-push-deps:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v30
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- uses: cachix/cachix-action@v15
with:
name: crane
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Update flake.lock
id: flakeupdate
uses: DeterminateSystems/update-flake-lock@v24
with:
token: ${{ secrets.PAT_FLAKE_UPDATE }}
branch: "automation/flake-update"
pr-title: "Update internal flake.lock"
path-to-flake-dir: ./test
pr-labels: |
automated
dependencies
flake update
- name: Enable Pull Request Automerge
run: gh pr merge --squash --delete-branch --auto ${{ steps.flakeupdate.outputs.pull-request-number }}
env:
GH_TOKEN: ${{ secrets.PAT_FLAKE_UPDATE }}
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/examples/*/flake.lock
/result*
.direnv
gcroot
result*
target/
/extra-tests/*/alt-store
/extra-tests/*/flake.lock
Loading