Skip to content

Commit

Permalink
chore: set up Flakebox
Browse files Browse the repository at this point in the history
  • Loading branch information
dpc committed Oct 6, 2023
1 parent cdbaba9 commit 196e83e
Show file tree
Hide file tree
Showing 15 changed files with 673 additions and 95 deletions.
1 change: 1 addition & 0 deletions .config/flakebox/id
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4bef2ccb693617da03555f48eb47b0a1521eff57b107f63ef255e94e0518216ec12e293bd8a1551c6d7283294e6c467ba77bc669e7e14e79006eb74d87fd13f4
22 changes: 22 additions & 0 deletions .config/flakebox/shellHook.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash
dot_git="$(git rev-parse --git-common-dir)"
if [[ ! -d "${dot_git}/hooks" ]]; then mkdir -p "${dot_git}/hooks"; fi
rm -f "${dot_git}/hooks/commit-msg"
ln -sf "$(pwd)/misc/git-hooks/commit-msg" "${dot_git}/hooks/commit-msg"

dot_git="$(git rev-parse --git-common-dir)"
if [[ ! -d "${dot_git}/hooks" ]]; then mkdir -p "${dot_git}/hooks"; fi
rm -f "${dot_git}/hooks/pre-commit"
ln -sf "$(pwd)/misc/git-hooks/pre-commit" "${dot_git}/hooks/pre-commit"

# set template
git config commit.template misc/git-hooks/commit-template.txt

if [ -n "${DIRENV_IN_ENVRC:-}" ]; then
# and not set DIRENV_LOG_FORMAT
if [ -n "${DIRENV_LOG_FORMAT:-}" ]; then
>&2 echo "💡 Set 'DIRENV_LOG_FORMAT=\"\"' in your shell environment variables for a cleaner output of direnv"
fi
fi

>&2 echo "💡 Run 'just' for a list of available 'just ...' helper recipes"
Empty file added .config/semgrep.yaml
Empty file.
76 changes: 76 additions & 0 deletions .github/workflows/flakebox-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# THIS FILE IS AUTOGENERATED FROM FLAKEBOX CONFIGURATION

jobs:
build:
name: Build
runs-on: ${{ matrix.runs-on }}
steps:
- uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v4
- name: Magic Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@v2
- name: Build on ${{ matrix.host }}
run: nix build .#ci.rblake2sum
strategy:
matrix:
host:
- macos
- linux
include:
- host: linux
runs-on: ubuntu-latest
timeout: 60
- host: macos
runs-on: macos-12
timeout: 60
timeout-minutes: ${{ matrix.timeout }}
flake:
name: Flake self-check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check Nix flake inputs
uses: DeterminateSystems/flake-checker-action@v5
with:
fail-mode: true
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v4
- name: Magic Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@v2
- name: Cargo Cache
uses: actions/cache@v3
with:
key: ${{ runner.os }}-${{ hashFiles('Cargo.lock') }}
path: ~/.cargo
- name: Commit Check
run: '# run the same check that git `pre-commit` hook does
nix develop --ignore-environment .# --command ./misc/git-hooks/pre-commit
'
name: CI
'on':
merge_group:
branches:
- master
- main
pull_request:
branches:
- master
- main
push:
branches:
- master
- main
tags:
- v*
workflow_dispatch: {}


# THIS FILE IS AUTOGENERATED FROM FLAKEBOX CONFIGURATION
34 changes: 34 additions & 0 deletions .github/workflows/flakebox-flakehub-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# THIS FILE IS AUTOGENERATED FROM FLAKEBOX CONFIGURATION

jobs:
flakehub-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: '${{ (inputs.tag != null) && format(''refs/tags/{0}'', inputs.tag) ||
'''''' }}
'
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v4
- name: Flakehub Push
uses: DeterminateSystems/flakehub-push@main
with:
name: ${{ github.repository }}
tag: ${{ inputs.tag }}
visibility: public
name: Publish to Flakehub
'on':
push:
tags:
- v?[0-9]+.[0-9]+.[0-9]+*
workflow_dispatch:
inputs:
tags:
description: The existing tag to publish to FlakeHub
required: true
type: string


# THIS FILE IS AUTOGENERATED FROM FLAKEBOX CONFIGURATION
4 changes: 4 additions & 0 deletions .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
group_imports = "StdExternalCrate"
wrap_comments = true
format_code_in_doc_comments = true
imports_granularity = "Module"
20 changes: 20 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,23 @@ blake2 = "0.10.6"
crev-recursive-digest = { version = "0.6.0" }
hex = "0.4"
clap = { version = "4.2.7", features = ["derive"] }


[profile.release]
lto = "fat"
codegen-units = 1
strip = true

[profile.ci]
inherits = "dev"
debug = 1
incremental = false

# Workaround: https://github.com/rust-lang/cargo/issues/12457 which causes
# https://github.com/ipetkov/crane/issues/370
[profile.dev.build-override]
debug = false
[profile.ci.build-override]
debug = false
[profile.release.build-override]
debug = false
2 changes: 1 addition & 1 deletion ci/prep_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ cp rblake2sum/README.md LICENSE* "$name/"
tar czvf "$name.tar.gz" "$name"

# Get the sha-256 checksum w/o filename and newline
echo -n $(shasum -ba 256 "$name.tar.gz" | cut -d " " -f 1) > "$name.tar.gz.sha256"
echo -n "$(shasum -ba 256 "$name.tar.gz" | cut -d " " -f 1)" > "$name.tar.gz.sha256"

2 changes: 1 addition & 1 deletion ci/travis-musl-openssl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ case "$TARGET" in
OPTIONS=(linux-x86_64)
;;
i686-*)
OPTIONS=(linux-generic32 -m32 -Wl,-melf_i386)
OPTIONS=(linux-generic32 -m32 "-Wl,-melf_i386")
;;
esac

Expand Down
Loading

0 comments on commit 196e83e

Please sign in to comment.