diff --git a/.build.yml b/.build.yml new file mode 100644 index 0000000..55108f4 --- /dev/null +++ b/.build.yml @@ -0,0 +1,23 @@ +image: nixos/latest +sources: + - git@git.sr.ht:~cyplo/bakare + +secrets: + - b7161fff-05f4-4470-b4a1-57bd67dede23 + - 996295b0-681c-49e8-8774-1be2f3e0bfe9 + +environment: + CI: "true" + +tasks: + - test: | + cd bakare + nix-shell --pure --run "./scripts/test.sh" + nix-shell --pure --run "./scripts/package.sh" + + - github_push: | + set +xv + cd bakare + GITHUB_TOKEN=`cat ~/.github_token` + git remote add github https://cyplo:$GITHUB_TOKEN@github.com/cyplo/bakare.git + nix-shell --pure --run 'git push github --all --force' diff --git a/scripts/package.sh b/scripts/package.sh new file mode 100755 index 0000000..dae224d --- /dev/null +++ b/scripts/package.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +set -e + +cargo doc +cargo package diff --git a/scripts/test.sh b/scripts/test.sh new file mode 100755 index 0000000..03707d1 --- /dev/null +++ b/scripts/test.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +set -e + +if [[ ! -z $CI ]]; then + export CARGO_HUSKY_DONT_INSTALL_HOOKS=true +fi + +cargo fmt -- --check +cargo clippy --all-targets --all-features -- -D warnings +cargo check +cargo test +cargo test -- --ignored