mkdtravis/travis-tests:.travis.yml@795ed27
#3.2.1.3 1/16
import:
- stages.yml
- ifs.yml
- ifs-with-envs.yml
- secure.yml
- sleep.yml
arch: s390x
os: linux
dist: focal
language: ruby
rvm:
- 2.7.5
jobs:
allow_failures:
- os: linux
dist: focal
language: ruby
rvm: 2.7.5
#testing again
mkdtravis/travis-tests:stages.yml@795ed27
# cases for build-stages https://docs.travis-ci.com/user/build-stages/
# - sequence of stages
# - named stages
# TODO: add bash output or comment whether expected result of the job is to pass or fail at each job in matrix
jobs:
include:
- stage: "First"
name: "First stage"
script: ruby ./source/ruby_hello.rb
# in 'Second' ruby exception is raised, this specific job should fail in terms of particular build job status
- stage: "Second"
name: "Second stage"
script: ruby ./source/fail.rb
- stage: "Next"
name: "Next stage"
script: ruby ./source/fine.rb
mkdtravis/travis-tests:ifs.yml@795ed27
# testing conditionals - travis-yml and later scheduler involved
# ==
# testing running build from specific branch (branch must exist ), allow failure must be
# used in root travis.yml (https://docs.travis-ci.com/user/conditional-builds-stages-jobs/)
# building branches - https://docs.travis-ci.com/user/customizing-the-build/#building-specific-branches
# ==
# commit messages: https://docs.travis-ci.com/user/customizing-the-build/#skipping-a-build
# example: do something if commit message has specific value e.g. 'docker'
jobs:
include:
- stage: "IFS - first"
name: "IFS - first stage"
if: branch = integration-regresion-tests
script: ruby ./source/ruby_hello.rb
- stage: "IFS - on commit"
name: "IFS - on commit stage"
if: commit_message =~ /docker/
script: ruby ./source/ruby_hello.rb
- stage: "IFS with envs - next - never run"
name: "IFS with envs - next - never run stage"
if: branch = not-existant-branch
script: ruby ./source/ruby_hello.rb
mkdtravis/travis-tests:ifs-with-envs.yml@795ed27
# testing conditionals - travis-yml and later scheduler involved
# ==
# testing conditional actions dependent on environmental variable definition for the build job
# testing on specific branch + job stages thrown in
env:
- MY_ENV=myenv
- ANOTHER_ENV=another_env
jobs:
include:
- stage: "IFS with envs - first"
name: "IFS with envs - first stage"
if: branch = integration-regresion-tests
script: ruby ./source/ruby_hello.rb
- stage: "IFS with envs - two"
name: "IFS with envs - second stage"
env: MY_ENV=myenv
script: ruby ./source/ruby_hello.rb
- stage: "IFS with envs - third - never run"
name: "IFS with envs - third - never run stage"
env: MISSING_ENV=missing_env
script: ruby ./source/ruby_hello.rb
mkdtravis/travis-tests:secure.yml@795ed27
# using encrypted variables: https://docs.travis-ci.com/user/encryption-keys/
# one must first create encrypted variables using travis-cli
# to run this job properly, one may need to fork the repository or be a collaborator
jobs:
include:
- stage: "Secure stage I"
name: "Secure stage I"
script: echo $MANA_MANA
mkdtravis/travis-tests:sleep.yml@795ed27
# testing mechanisms for autocancelling the jobs (travis-hub + worker involved)
jobs:
include:
# a job that does not puts out enything to cli (job log) for first 10 minutes - we expect autocancel on that job to happen
- stage: "Sleep First"
name: "Sleep First stage"
script: ruby ./source/over_ten_minutes.rb
# a job that runs for more than 50 minutes (an output to cli (job log) must be done with intervals < 10 mins) - we expect autocancel at around 50 minutes mark here
- stage: "Sleep Second"
name: "Sleep Second stage"
script: ruby ./source/over_fifty_minutes.rb
Build Config
{
"language": "ruby",
"os": [
"linux"
],
"dist": "focal",
"arch": [
"s390x"
],
"rvm": [
"2.7.5"
],
"jobs": {
"allow_failures": [
{
"os": "linux",
"dist": "focal",
"language": "ruby",
"rvm": "2.7.5"
}
],
"include": [
{
"stage": "Sleep First",
"name": "Sleep First stage",
"script": [
"ruby ./source/over_ten_minutes.rb"
]
},
{
"stage": "Sleep Second",
"name": "Sleep Second stage",
"script": [
"ruby ./source/over_fifty_minutes.rb"
]
},
{
"stage": "Secure stage I",
"name": "Secure stage I",
"script": [
"echo $MANA_MANA"
]
},
{
"stage": "IFS with envs - first",
"name": "IFS with envs - first stage",
"if": "branch = integration-regresion-tests",
"script": [
"ruby ./source/ruby_hello.rb"
]
},
{
"stage": "IFS with envs - two",
"name": "IFS with envs - second stage",
"env": [
{
"MY_ENV": "myenv"
}
],
"script": [
"ruby ./source/ruby_hello.rb"
]
},
{
"stage": "IFS with envs - third - never run",
"name": "IFS with envs - third - never run stage",
"env": [
{
"MISSING_ENV": "missing_env"
}
],
"script": [
"ruby ./source/ruby_hello.rb"
]
},
{
"stage": "IFS - first",
"name": "IFS - first stage",
"if": "branch = integration-regresion-tests",
"script": [
"ruby ./source/ruby_hello.rb"
]
},
{
"stage": "IFS - on commit",
"name": "IFS - on commit stage",
"if": "commit_message =~ /docker/",
"script": [
"ruby ./source/ruby_hello.rb"
]
},
{
"stage": "IFS with envs - next - never run",
"name": "IFS with envs - next - never run stage",
"if": "branch = not-existant-branch",
"script": [
"ruby ./source/ruby_hello.rb"
]
},
{
"stage": "First",
"name": "First stage",
"script": [
"ruby ./source/ruby_hello.rb"
]
},
{
"stage": "Second",
"name": "Second stage",
"script": [
"ruby ./source/fail.rb"
]
},
{
"stage": "Next",
"name": "Next stage",
"script": [
"ruby ./source/fine.rb"
]
}
]
},
"env": {
"jobs": [
{
"MY_ENV": "myenv"
},
{
"ANOTHER_ENV": "another_env"
}
]
}
}