-
-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
213 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: "CI/CD" | ||
|
||
"on": | ||
push: {} | ||
|
||
jobs: | ||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Install Nix | ||
uses: DeterminateSystems/nix-installer-action@v9 | ||
- | ||
name: "Test: integration test" | ||
run: nix flake check |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
inputs = { | ||
tomono.url = "github:hraban/tomono"; | ||
}; | ||
|
||
outputs = { | ||
self, nixpkgs, flake-utils, tomono | ||
}: | ||
flake-utils.lib.eachDefaultSystem (system: | ||
let | ||
pkgs = nixpkgs.legacyPackages.${system}; | ||
in | ||
{ | ||
checks.default = with pkgs; stdenvNoCC.mkDerivation { | ||
name = "test"; | ||
checkPhase = ./test.sh; | ||
doCheck = true; | ||
src = ./.; | ||
nativeBuildInputs = [ makeWrapper moreutils git tomono.packages.${system}.default ]; | ||
installPhase = "touch $out"; | ||
}; | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
set -x | ||
|
||
# Ensure testing always works even on unconfigured CI etc | ||
export GIT_AUTHOR_NAME="Test" | ||
export GIT_AUTHOR_EMAIL="[email protected]" | ||
export GIT_COMMITTER_NAME="Test" | ||
export GIT_COMMITTER_EMAIL="[email protected]" | ||
|
||
d="$(mktemp -d)" | ||
cd "$d" | ||
pwd | ||
|
||
mkdir a | ||
( | ||
cd a | ||
git init | ||
(for i in {1..9} ; do echo $i ; done) > count.txt | ||
git add count.txt | ||
git commit -m "count from 1 to 9" | ||
git checkout -b more-numbers | ||
echo 10 >> count.txt | ||
git add count.txt | ||
git commit -m "append 10" | ||
) | ||
|
||
echo "$PWD/a" a | tomono | ||
|
||
( | ||
cd core/a | ||
# In master | ||
(echo 0; cat count.txt) | sponge count.txt | ||
git add count.txt | ||
git commit -m "count from 0" | ||
# Continue dev | ||
git checkout more-numbers | ||
echo 11 >> count.txt | ||
git add count.txt | ||
git commit -m "count to 11" | ||
# Merge it all | ||
git checkout master | ||
git merge more-numbers -m "merge dev" | ||
) | ||
|
||
echo "Finished dev:" | ||
cat core/a/count.txt |