Skip to content

Commit

Permalink
chore: setup 'retry' in CircleCI to avoid false-negative
Browse files Browse the repository at this point in the history
  • Loading branch information
moul committed Apr 25, 2019
1 parent af5c583 commit c4b318f
Showing 1 changed file with 24 additions and 14 deletions.
38 changes: 24 additions & 14 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
version: 2

refs:
install_retry: &install_retry
run:
name: install retry
command: |
command -v wget &>/dev/null && wget -O /tmp/retry "https://github.com/moul/retry/releases/download/v0.5.0/retry_$(uname -s)_$(uname -m)" || true
if [ ! -f /tmp/retry ]; then command -v curl &>/dev/null && curl -L -o /tmp/retry "https://github.com/moul/retry/releases/download/v0.5.0/retry_$(uname -s)_$(uname -m)"; fi
chmod +x /tmp/retry
/tmp/retry --version
jobs:
# lint: # various linting
# generate # this job generates files ('make generate') and raise an error if the generated files are not the same as before
Expand All @@ -12,7 +22,8 @@ jobs:
steps:
- checkout
- setup_remote_docker
- run: docker build -t pathwar/pathwar .
- *install_retry
- run: /tmp/retry -m 3 docker build -t pathwar/pathwar .
# FIXME: save cache

# build and unit test the project
Expand All @@ -27,12 +38,13 @@ jobs:
- checkout
# FIXME: restore cache
- run: go clean -modcache
- run: go get
- run: make _ci_prepare
- run: make test
- *install_retry
- run: /tmp/retry -m 3 go get
- run: /tmp/retry -m 3 make _ci_prepare
- run: /tmp/retry -m 3 make test
# FIXME: setup coverage
- run: curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s v1.12.2
- run: PATH=$PATH:$(pwd)/bin make lint
- run: /tmp/retry -m 3 curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s v1.12.2
- run: PATH=$PATH:$(pwd)/bin /tmp/retry -m 3 make lint
# FIXME: save cache
# FIXME: store_test_results

Expand All @@ -41,16 +53,14 @@ jobs:
- image: docker/compose:1.24.0
steps:
- checkout
- run:
name: Install Deps
command: |
apk --no-cache add curl openssl make bash
- *install_retry
- run: /tmp/retry -m 3 apk --no-cache add curl openssl make bash
- setup_remote_docker:
docker_layer_caching: true
- run: docker build -t pathwar/pathwar .
- run: docker build -t pathwar/pathwar:test ./test
- run: make integration.run
- run: make integration.run # yes, again
- run: /tmp/retry -m 3 docker build -t pathwar/pathwar .
- run: /tmp/retry -m 3 docker build -t pathwar/pathwar:test ./test
- run: /tmp/retry -m 3 make integration.run
- run: /tmp/retry -m 3 make integration.run # yes, again
- run: docker-compose logs

workflows:
Expand Down

0 comments on commit c4b318f

Please sign in to comment.