version: 2.1 jobs: run-static-analysis: parameters: version: type: string docker: - image: circleci/golang:<< parameters.version >> environment: GO111MODULE: "on" # work around for recent circle CI breaking change # Error: "Error response from daemon: client version 1.39 is too new. Maximum supported API version is 1.38" DOCKER_API_VERSION: "1.38" # 1CPU / 2GB RAM resource_class: small steps: - checkout - restore_cache: keys: - go-<< parameters.version >>-{{ checksum "go.sum" }}-{{ checksum "Makefile" }} - run: make ci-bootstrap - save_cache: key: go-<< parameters.version >>-{{ checksum "go.sum" }}-{{ checksum "Makefile" }} paths: - "/go/pkg/mod" - ".tmp" - run: name: run static analysis command: make lint run-tests: parameters: version: type: string docker: - image: circleci/golang:<< parameters.version >> environment: GO111MODULE: "on" # work around for recent circle CI breaking change # Error: "Error response from daemon: client version 1.39 is too new. Maximum supported API version is 1.38" DOCKER_API_VERSION: "1.38" # 1CPU / 2GB RAM resource_class: small steps: - checkout - restore_cache: keys: - go-<< parameters.version >>-{{ checksum "go.sum" }}-{{ checksum "Makefile" }} - run: make ci-bootstrap - save_cache: key: go-<< parameters.version >>-{{ checksum "go.sum" }}-{{ checksum "Makefile" }} paths: - "/go/pkg/mod" - ".tmp" - setup_remote_docker: version: 18.06.0-ce - run: name: enable docker client command: | # all of this to enable "circleci local execute ..." cli commands for /var/run/docker.sock mkdir -p ${HOME}/.local/bin cat \<< EOF > ${HOME}/.local/bin/docker #!/bin/bash set -xue sudo -E ${HOME}/.local/bin/docker.bin \$@ EOF sudo mv /usr/bin/docker ${HOME}/.local/bin/docker.bin chmod 755 ${HOME}/.local/bin/docker - run: name: build cache key for java test-fixture blobs command: make java-packages-fingerprint - restore_cache: keys: - unit-test-java-cache-{{ checksum "syft/cataloger/java/test-fixtures/java-builds/packages.fingerprint" }} - run: name: run unit tests command: make unit - save_cache: key: unit-test-java-cache-{{ checksum "syft/cataloger/java/test-fixtures/java-builds/packages.fingerprint" }} paths: - "syft/cataloger/java/test-fixtures/java-builds/packages" - run: name: build hash key for integration test-fixtures blobs command: make integration-fingerprint - restore_cache: keys: - integration-test-tar-cache-{{ checksum "test/integration/test-fixtures/tar-cache.fingerprint" }} - run: name: run integration tests command: make integration - save_cache: key: integration-test-tar-cache-{{ checksum "test/integration/test-fixtures/tar-cache.fingerprint" }} paths: - "test/integration/test-fixtures/tar-cache" workflows: # Note: changing this workflow name requires making the same update in the .github/workflows/release.yaml pipeline "Static Analysis + Unit + Integration": jobs: - run-static-analysis: name: "Static Analysis" version: "1.14" - run-tests: name: "Unit & Integration Tests (go-1.13)" version: "1.13" - run-tests: name: "Unit & Integration Tests (go-latest)" version: "latest"