Skip to content

Commit

Permalink
fix: ci fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
brynblack committed Feb 15, 2024
1 parent 3b593c0 commit 20541c3
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 22 deletions.
4 changes: 1 addition & 3 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,7 @@ check:nix-dry:
needs: []
script:
- >
nix develop .#ci --command bash -c $'
nix build --dry-run .#docker;
'
nix build .#docker --dry-run
rules:
# Runs on feature and staging commits and ignores version commits
- if: $CI_COMMIT_BRANCH =~ /^(?:feature.*|staging)$/ && $CI_COMMIT_TITLE !~ /^[0-9]+\.[0-9]+\.[0-9]+(?:-.*[0-9]+)?$/
Expand Down
2 changes: 0 additions & 2 deletions .npmrc

This file was deleted.

8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,8 @@ nix profile install github:MatrixAI/Polykey-CLI
Install into Docker:

```sh
docker load < result
docker run -it "$image"

loaded="$(docker load --input "$(nix-build ./release.nix --attr docker --argstr npmDepsHash "$(prefetch-npm-deps ./package-lock.json)")")"
image="$(cut -d' ' -f3 <<< "$loaded")"
docker run -it "$image"
nix build .#docker
docker load < result | cut -d' ' -f3 | xargs docker run -i
```

## Development
Expand Down
7 changes: 4 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
nixpkgs.url = "github:NixOS/nixpkgs?rev=ea5234e7073d5f44728c499192544a84244bf35a";
flake-utils.url = "github:numtide/flake-utils";
};

Expand Down Expand Up @@ -44,9 +44,7 @@
dockerImage = pkgs.dockerTools.buildImage {
name = polykey_cli.name;
copyToRoot = [ polykey_cli ];
# This ensures symlinks to directories are preserved in the image
keepContentsDirlinks = true;
# This adds a correct timestamp, however breaks binary reproducibility
created = "now";
extraCommands = ''
mkdir -m 1777 tmp
Expand All @@ -60,7 +58,6 @@
shell = { ci ? false }: with pkgs; pkgs.mkShell {
nativeBuildInputs = [
nodejs
prefetch-npm-deps
shellcheck
gitAndTools.gh
gitAndTools.git
Expand All @@ -87,7 +84,6 @@
}
mkdir --parents "$(pwd)/tmp"
# Built executables and NPM executables
export PATH="$(pwd)/dist/bin:$(npm root)/.bin:$PATH"
npm install --ignore-scripts
Expand Down
4 changes: 2 additions & 2 deletions scripts/check-test-generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ check:test $test_dir:
needs: []
script:
- >
nix-shell --arg ci true --run $'
nix develop .#ci --command bash -c $'
npm test -- --ci --coverage ${test_files[@]};
'
artifacts:
Expand All @@ -94,7 +94,7 @@ check:test index:
needs: []
script:
- >
nix-shell --arg ci true --run $'
nix develop .#ci --command bash -c $'
npm test -- --ci --coverage ${test_files[@]};
'
artifacts:
Expand Down
2 changes: 1 addition & 1 deletion scripts/npmDepsHash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

newHash=$(nix-shell -p prefetch-npm-deps --run "prefetch-npm-deps ./package-lock.json")

echo $newHash > ./npmDepsHash
echo "$newHash" > ./npmDepsHash

0 comments on commit 20541c3

Please sign in to comment.