# Golang CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-go/ for more details
version: 2
jobs:
  build:
    docker:
      # specify the version
      - image: circleci/golang:1.18
      # Specify service dependencies here if necessary
      # CircleCI maintains a library of pre-built images
      # documented at https://circleci.com/docs/2.0/circleci-images/
      - image: postgres:9.6
        environment:
          POSTGRES_DB: postgres
          POSTGRES_USER: postgres
          POSTGRES_PASSWORD: password
    #### TEMPLATE_NOTE: go expects specific checkout path representing url
    #### expecting it in the form of
    ####   /go/src/github.com/circleci/go-tool
    ####   /go/src/bitbucket.org/circleci/go-tool
    working_directory: /go/src/github.com/grafeas/grafeas/
    steps:
      - checkout
      - setup_remote_docker
      # ensures the Grafeas server image can be built
      - run: docker build .
      # specify any bash command here prefixed with `run: `
      - run: make build; make test
workflows:
  version: 2
  commit:
    jobs:
      - build
  nightly:
    triggers:
      - schedule:
          # Every day at midnight.
          cron: "0 0 * * *"
          filters:
            branches:
              only:
                - master
    jobs:
      - build

# Golang CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-go/ for more details
version: 2
jobs:
  build:
    docker:
      # specify the version
      - image: cimg/go:1.18
      # Specify service dependencies here if necessary
      # CircleCI maintains a library of pre-built images
      # documented at https://circleci.com/docs/2.0/circleci-images/
      - image: postgres:9.6
        environment:
          POSTGRES_DB: postgres
          POSTGRES_USER: postgres
          POSTGRES_PASSWORD: password
    #### TEMPLATE_NOTE: go expects specific checkout path representing url
    #### expecting it in the form of
    ####   /go/src/github.com/circleci/go-tool
    ####   /go/src/bitbucket.org/circleci/go-tool
    working_directory: /go/src/github.com/grafeas/grafeas/
    steps:
      - checkout
      - setup_remote_docker
      # ensures the Grafeas server image can be built
      - run: docker build .
      # specify any bash command here prefixed with `run: `
      - run: make build; make test
workflows:
  version: 2
  commit:
    jobs:
      - build
  nightly:
    triggers:
      - schedule:
          # Every day at midnight.
          cron: "0 0 * * *"
          filters:
            branches:
              only:
                - master
    jobs:
      - build

Upgrade CircleCI image to cimg/go:1.18
Upgrade CircleCI image to cimg/go:1.18
