Skip to content

Add nix build file #110

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Oct 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,10 @@
/parts
/prime
.gitignore.swp
Cargo.lock


# needed for nix
# Cargo.lock

# nix result from nix-build
result
24 changes: 16 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,21 @@ os:
- linux
- windows
- osx
sudo: false
script:
- cargo build --verbose
- cargo test --verbose
notifications:
email:
on_success: never
branches:
only:
- master
- cargo build --verbose
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking forward to merging your PR 👍 ! Just one quick question:
Why move cargo build below cargo test? Tests require a successful build. If the project has not been built, cargo test will build it, so building after tests have run successfully is a bit redundant.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No very good reason, personally I would first execute the tests, and then build, but that's the complete reason. But we maybe should change the cargo build to --release, and then there are different builds, which makes it irrelevant.

So, Should I change it, or make cargo build a release build?

jobs:
include:
- language: nix
cache:
directories:
- $HOME/nix.store
script:
- nix-build
before_install:
- sudo mkdir -p /etc/nix
- echo "substituters = https://cache.nixos.org/ file://$HOME/nix.store" | sudo tee -a /etc/nix/nix.conf > /dev/null
- echo 'require-sigs = false' | sudo tee -a /etc/nix/nix.conf > /dev/null
before_cache:
- mkdir -p $HOME/nix.store
- nix copy --to file://$HOME/nix.store -f default.nix buildInputs
Loading