--- version: 2.1 executors: container: docker: - image: circleci/golang:1.14 environment: GOCACHE: &gocache /tmp/go-build working_directory: &workdir /go/src/github.com/seccomp/containers-golang 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 "go.sum" }} - run: name: build command: make - save_cache: key: v1-build-{{ checksum "go.sum" }} paths: - *gocache - persist_to_workspace: root: . paths: - seccomp.json - store_artifacts: path: generate destination: generate - store_artifacts: path: seccomp.json destination: seccomp.json unit-tests: executor: container steps: - <<: *prepare-env - checkout - attach_workspace: at: . - restore_cache: keys: - v1-unit-tests-{{ checksum "go.sum" }} - run: name: unit tests command: make test-unit - save_cache: key: v1-unit-tests-{{ checksum "go.sum" }} paths: - *gocache vendor: executor: container steps: - <<: *prepare-env - checkout - restore_cache: keys: - v1-vendor-{{ checksum "go.sum" }} - run: name: check vendoring command: | make vendor hack/tree_status.sh - run: name: check profile consistency command: | make seccomp.json git diff --exit-code - save_cache: key: v1-vendor-{{ checksum "go.sum" }} paths: - /go/pkg