sliproad/.circleci/config.yml
2020-04-03 13:57:54 +01:00

57 lines
1.4 KiB
YAML

version: 2
jobs:
build:
docker:
- image: cimg/go:1.14
steps:
- checkout
- restore_cache:
keys:
- go-mod-{{ checksum "go.sum" }}-v2
- go-mod-{{ checksum "go.sum" }}
- go-mod
- restore_cache:
keys:
- upx-3.96-v2
- run:
name: Install UPX
command: |
echo 'export PATH=$PATH:/home/circleci/upx/bin' >> $BASH_ENV
if ! type "upx" > /dev/null; then
wget https://github.com/upx/upx/releases/download/v3.96/upx-3.96-amd64_linux.tar.xz
tar xf upx-3.96-amd64_linux.tar.xz
mkdir -p /home/circleci/upx/bin
mv upx-3.96-amd64_linux/upx /home/circleci/upx/bin
chmod +x /home/circleci/upx/bin/upx
fi
- run:
command: make dist
- store_artifacts:
path: build
- save_cache:
key: go-mod-{{ checksum "go.sum" }}-v2
paths:
- /home/circleci/go/pkg/mod
- save_cache:
key: upx-3.96-v2
paths:
- /home/circleci/upx
test:
docker:
- image: cimg/go:1.14
steps:
- checkout
- restore_cache:
keys:
- go-mod-{{ checksum "go.sum" }}-v2
- go-mod-{{ checksum "go.sum" }}
- go-mod
- run:
command: make test
workflows:
version: 2
build-and-test:
jobs:
- build
- test