travis-ci / beta-features

The perfect place to leave feedback and comments on newly released Beta Features.
56 stars 68 forks source link

Problem with conditional jobs #40

Closed tooomm closed 6 years ago

tooomm commented 6 years ago

This is about the beta feature Conditional Builds, Stages, and Jobs.

I have conditional jobs setup in my build matrix like (travis.yml)

matrix:
  include:
  - os: linux
    env: BUILDTYPE=Debug
  - os: linux
    env: BUILDTYPE=Release
    if: (branch = master AND NOT type = pull_request) OR tag IS present

That works fine with what I try to accomplish:

Problem is that I want to prevent Debug builds for tags in return. I tried with what the documentation gives me, but it did not work.

All of this if: statements still created a Debug job:

  - os: linux
    env: BUILDTYPE=Debug
    if: tag IS blank
  - os: linux
    env: BUILDTYPE=Debug
    if: tag IS NOT present
  - os: linux
    env: BUILDTYPE=Debug
    if: tag NOT present

Also, using env(TRAVIS_TAG) instead tag didn't help.

Any suggestions? Did I run into an issue/bug? It's confusing because tag IS present seems to work for my configuration for Release as shown above.

Croydon commented 6 years ago

This feature worked but did broke some while ago.

No official statement from Travis staff as far as I can see. This got discussed in #28

tooomm commented 6 years ago

Thanks for letting me know and linking me there @Croydon. Subscribed for updates! 👍

webknjaz commented 6 years ago

Ref. https://github.com/travis-ci/beta-features/issues/28#issuecomment-358705563

Dids commented 6 years ago

I feel like there's something wrong with the git parsing entirely.

I disabled the conditionals entirely, and tried to get several deployments to fire (GitHub Releases and NuGet upload), but much to my surprise Travis only pushed to GitHub, but not to NuGet:

Skipping a deployment with the script provider because this branch is not permitted: v1.0.0-beta8
Skipping a deployment with the script provider because this is not a tagged commit

So for whatever reason it thinks that the tag is the branch, and that the tag doesn't exist?

tooomm commented 6 years ago

My issue is fixed with https://github.com/travis-ci/travis-conditions/pull/1

(also see https://github.com/travis-ci/beta-features/issues/28#issuecomment-406340127 and https://blog.travis-ci.com/2018-07-18-build-stages-officially-released)

@Dids It looks like your issue is about something else. You might want to open your own issue. I suggest the normal travis repo as well as it looks that your problem is not to related to any beta features.