Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PaymentServer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Administrator
PaymentServer
Commits
9fbb1037
Commit
9fbb1037
authored
5 years ago
by
Jean-Paul Calderone
Browse files
Options
Downloads
Patches
Plain Diff
comments
parent
44619f94
No related branches found
Branches containing commit
No related tags found
1 merge request
!14
Try out a CircleCI configuration
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.circleci/config.yml
+45
-1
45 additions, 1 deletion
.circleci/config.yml
with
45 additions
and
1 deletion
.circleci/config.yml
+
45
−
1
View file @
9fbb1037
...
...
@@ -17,27 +17,54 @@ version: 2.1
jobs
:
test
:
docker
:
# Run in a highly Nix-capable environment. This lets us use Stack's nix
# integration and other useful Nix features to specify and run the
# build.
-
image
:
"
nixorg/nix:circleci"
environment
:
# Specify a revision of NixOS/nixpkgs to run against. This essentially
# pins the majority of the software involved in the build. This
# revision is selected arbitrarily. It's somewhat current as of the
# time of this comment. We can bump it to a newer version when that
# makes sense. Meanwhile, the platform won't shift around beneath us
# unexpectedly.
NIXPKGS_REV
:
"
3c83ad6ac13b67101cc3e2e07781963a010c1624"
steps
:
-
run
:
# Get NIX_PATH set for the rest of the job so that the revision of
# nixpkgs we selected will be used everywhere Nix pulls in software.
# There is no way to set an environment variable containing the
# value of another environment variable on CircleCI except to use
# the `BASE_ENV` feature as we do here.
name
:
"
Setup
NIX_PATH
Environment
Variable"
command
:
|
echo "export NIX_PATH=nixpkgs=https://github.com/NixOS/nixpkgs/archive/$NIXPKGS_REV.tar.gz" >> $BASH_ENV
-
restore_cache
:
# Get all of Nix's state relating to the particular revision of
# nixpkgs we're using. It will always be the same. CircleCI
# artifacts and nixpkgs store objects are probably mostly hosted in
# the same place (S3) so there's not a lot of difference for
# anything that's pre-built. For anything we end up building
# ourselves, though, this saves us all of the build time (less the
# download time).
#
# Read about caching dependencies: https://circleci.com/docs/2.0/caching/
name
:
"
Restore
Nix
Store
Paths"
keys
:
-
paymentserver-nix-store-v1-{{ .Environment.NIXPKGS_REV }}
-
paymentserver-nix-store-v1-
# Get *our* source code.
-
"
checkout"
-
restore_cache
:
# Read about caching dependencies: https://circleci.com/docs/2.0/caching/
# Restore the cache of Stack's state. This will have all of the
# compiled Haskell libraries we depend on and even the compiled
# output of our own libraries, if the source hasn't changed since
# the cache was written (but usually it will have).
name
:
"
Restore
Cached
Dependencies"
keys
:
-
paymentserver-v1-{{ checksum "stack.yaml" }}-{{ checksum "PaymentServer.cabal" }}
...
...
@@ -46,6 +73,20 @@ jobs:
-
run
:
name
:
"
Run
Tests"
command
:
|
# shell.nix gives us the stack we want. Then stack.yaml specifies
# some more of the Nix-based environment to be able to build and
# run the tests.
#
# --no-terminal avoids having fancy progress reports written to
# stdout.
#
# --coverage gathers test coverage information to be published
# below.
#
# --fast turns off compiler optimizations which probably doesn't
# make a lot of difference in our code but it can speed up build
# times for our dependencies (as well as reduce compiler memory
# usage which may be important at least for stripe-core).
nix-shell shell.nix --run "stack build --no-terminal --test --coverage --fast"
-
save_cache
:
...
...
@@ -62,6 +103,7 @@ jobs:
-
"
/nix"
-
store_artifacts
:
# There may be useful build logs here.
path
:
"
.stack-work/logs"
-
run
:
...
...
@@ -70,6 +112,8 @@ jobs:
mv $(nix-shell shell.nix --run "stack path --local-install-root")/hpc /tmp
-
store_artifacts
:
# This contains the html coverage report as well as the raw data in
# .tix format.
path
:
"
/tmp/hpc"
destination
:
"
coverage"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment