This repository has been archived by the owner on Aug 28, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from openSUSE/ci
Add CI support
- Loading branch information
Showing
5 changed files
with
889 additions
and
3 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,97 @@ | ||
--- | ||
version: 2.1 | ||
|
||
executors: | ||
container: | ||
docker: | ||
- image: circleci/golang | ||
environment: | ||
GOCACHE: &gocache /tmp/go-build | ||
working_directory: &workdir /go/src/github.com/seccomp/containers-golang | ||
container-base: | ||
docker: | ||
- image: circleci/golang | ||
environment: | ||
GOCACHE: *gocache | ||
working_directory: *workdir | ||
|
||
workflows: | ||
version: 2 | ||
pipeline: | ||
jobs: | ||
- build | ||
- unit-tests: | ||
requires: | ||
- build | ||
- vendor | ||
|
||
prepare-env: &prepare-env | ||
run: | ||
name: Install dependencies | ||
command: | | ||
sudo apt-get update | ||
sudo apt-get install -y \ | ||
libseccomp2 \ | ||
libseccomp-dev | ||
jobs: | ||
build: | ||
executor: container | ||
steps: | ||
- <<: *prepare-env | ||
- checkout | ||
- restore_cache: | ||
keys: | ||
- v1-build-{{ checksum "vendor.conf" }} | ||
- run: | ||
name: build | ||
command: make | ||
- save_cache: | ||
key: v1-build-{{ checksum "vendor.conf" }} | ||
paths: | ||
- *gocache | ||
- persist_to_workspace: | ||
root: . | ||
paths: | ||
- default.json | ||
- store_artifacts: | ||
path: generate | ||
destination: generate | ||
- store_artifacts: | ||
path: default.json | ||
destination: default.json | ||
|
||
unit-tests: | ||
executor: container | ||
steps: | ||
- <<: *prepare-env | ||
- checkout | ||
- attach_workspace: | ||
at: . | ||
- restore_cache: | ||
keys: | ||
- v1-unit-tests-{{ checksum "vendor.conf" }} | ||
- run: | ||
name: unit tests | ||
command: make test-unit | ||
- save_cache: | ||
key: v1-unit-tests-{{ checksum "vendor.conf" }} | ||
paths: | ||
- *gocache | ||
|
||
vendor: | ||
executor: container-base | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
keys: | ||
- v1-vendor-{{ checksum "go.sum" }} | ||
- run: | ||
name: check vendoring | ||
command: | | ||
make vendor | ||
hack/tree_status.sh | ||
- save_cache: | ||
key: v1-vendor-{{ checksum "go.sum" }} | ||
paths: | ||
- /go/pkg |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
default.json | ||
fixtures | ||
*.orig |
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
Oops, something went wrong.