]> git.r.bdr.sh - rbdr/mobius/blob - .circleci/config.yml
Convert bespoke methods to io.Reader/io.Writer interfaces
[rbdr/mobius] / .circleci / config.yml
1 # Use the latest 2.1 version of CircleCI pipeline process engine. See: https://circleci.com/docs/2.0/configuration-reference
2 version: 2.1
3 jobs:
4 build:
5 working_directory: ~/repo
6 docker:
7 - image: cimg/go:1.22.1
8 steps:
9 - checkout
10 # - restore_cache:
11 # keys:
12 # - go-mod-v4-{{ checksum "go.sum" }}
13 - run:
14 name: Install Dependencies
15 command: go mod download
16 # - save_cache:
17 # key: go-mod-v4-{{ checksum "go.sum" }}
18 # paths:
19 # - "/go/pkg/mod"
20 - run:
21 name: Run tests
22 command: |
23 mkdir -p /tmp/test-reports
24 gotestsum --junitfile /tmp/test-reports/unit-tests.xml
25 - store_test_results:
26 path: /tmp/test-reports
27
28 deploy:
29 docker:
30 - image: cimg/go:1.22.1
31 # working_directory: /go/src/github.com/jhalter/mobius
32 steps:
33 - checkout
34 - run: go get -u github.com/mitchellh/gox
35 - run: go install github.com/tcnksm/ghr@latest
36 - run: go install github.com/stevenmatthewt/semantics@latest
37 - run:
38 name: cross compile
39 command: |
40 make all
41 - add_ssh_keys
42 - run:
43 name: create release
44 command: |
45 tag=$(/home/circleci/go/bin/semantics --output-tag)
46 if [ "$tag" ]; then
47 /home/circleci/go/bin/ghr -t $GITHUB_TOKEN -u $CIRCLE_PROJECT_USERNAME -r $CIRCLE_PROJECT_REPONAME --replace $tag dist/
48 else
49 echo "The commit message(s) did not indicate a major/minor/patch version."
50 fi
51
52 workflows:
53 version: 2
54 build-deploy:
55 jobs:
56 - build
57 - deploy:
58 requires:
59 - build
60 filters:
61 branches:
62 only: master