Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

travis still being annoying #30

Closed
clux opened this issue Dec 12, 2017 · 1 comment
Closed

travis still being annoying #30

clux opened this issue Dec 12, 2017 · 1 comment

Comments

@clux
Copy link
Member

clux commented Dec 12, 2017

This is the current mess:

script:
- cargo clean
- if [ "$TRAVIS_PULL_REQUEST" = "true" ]; then cargo build; fi
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then docker run --rm -v $PWD:/volume -w /volume -t clux/muslrust cargo build --release; fi
- if [ "$TRAVIS_PULL_REQUEST" = "true" ]; then cargo test; fi
- if [ "$TRAVIS_PULL_REQUEST" = "true" ]; then cargo doc --no-deps; fi
branches:
  only:
  - master
  - /^v.*$/
before_deploy:
  - sudo chown -R $USER:$USER target
  - ldd target/x86_64-unknown-linux-musl/release/lal || true
  - mkdir ARTIFACT/{bin,share/lal} -p
  - mv target/x86_64-unknown-linux-musl/release/lal ARTIFACT/bin/
  - cp lal.complete.sh ARTIFACT/share/lal/
  - tar czf lal.tar.gz --transform=s,^ARTIFACT/,, $(find ARTIFACT/ -type f -o -type l)
deploy:
  provider: releases
  file: lal.tar.gz
  skip_cleanup: true
  on:
    tags: true
  api_key: ...
after_script: |
  if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [[ "$TRAVIS_RUST_VERSION" == stable ]]; then
    bash <(curl -sSL https://raw.githubusercontent.com/xd009642/tarpaulin/master/travis-install.sh)
    sudo chown -R $USER:$USER target
    cargo tarpaulin --ciserver travis-ci --coveralls $TRAVIS_JOB_ID
  fi

unfortunately when you push to a branch, that's NOT a TRAVIS_PULL_REQUEST, but a push to a non-master branch, even if it's also in a PR. Note the already crazy branch filtering that includes a semver regex to get travis to only upload releases on a new tag.

Hacks on top of hacks. Maybe try to do this with circleci?

@clux
Copy link
Member Author

clux commented Dec 14, 2017

ok, think i've fixed it in #9. The TRAVIS_EVENT_TYPE evar is less flaky than TRAVIS_PULL_REQUEST

@clux clux closed this as completed in 4f33c1f Dec 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant