Skip to content

Commit 4de4d77

Browse files
Merge pull request #62643 from aireilly/travis-speedup
Optimize the Travis build
2 parents 49b902f + df8a989 commit 4de4d77

File tree

2 files changed

+28
-42
lines changed

2 files changed

+28
-42
lines changed

.travis.yml

Lines changed: 25 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
language: python
2-
cache: pip
2+
cache:
3+
pip: true
4+
directories:
5+
- /home/travis/.rvm/gems
36
# env:
47
# - PR_AUTHOR=${TRAVIS_PULL_REQUEST_SLUG::-15}
58
git:
@@ -8,90 +11,73 @@ jobs:
811
allow_failures:
912
env:
1013
- CAN_FAIL=true
14+
1115
include:
12-
# fail if asciidoctor encounters errors
13-
- stage: validate
14-
name: "Validate updated assemblies with Asciidoctor"
16+
- stage: cache-and-validate
17+
name: "Create install cache and validate updated assemblies"
1518
install:
16-
- gem install asciidoctor
17-
- gem install asciidoctor-diagram
18-
- gem install rouge
19+
- gem install asciidoctor asciidoctor-diagram rouge
20+
- pip3 install pyyaml aura.tar.gz
1921
script:
20-
- chmod +x ./scripts/check-asciidoctor-build.sh
21-
- ./scripts/check-asciidoctor-build.sh
22+
# Fail if Asciidoctor encounters errors. Run only if there are modified AsciiDoc files
23+
- if ! [[ -z $(git diff --name-only HEAD~1 HEAD --diff-filter=d '*.adoc' ':(exclude)_unused_topics/*') ]]; then chmod +x ./scripts/check-asciidoctor-build.sh && ./scripts/check-asciidoctor-build.sh; fi
24+
2225
- stage: build
26+
if: branch IN (main, enterprise-4.13, enterprise-4.14)
2327
name: "Build openshift-enterprise distro"
24-
before_install:
25-
- gem install asciidoctor
26-
- gem install asciidoctor-diagram
27-
install:
28-
- pip3 install pyyaml
29-
- pip3 install aura.tar.gz
3028
script:
3129
- python3 build.py --distro openshift-enterprise --product "OpenShift Container Platform" --version 4.14 --no-upstream-fetch && python3 makeBuild.py
30+
3231
- # stage name not required, will continue to use `build`
3332
if: branch IN (main, enterprise-4.13, enterprise-4.14)
3433
name: "Build openshift-dedicated distro"
35-
before_install:
36-
- gem install asciidoctor
37-
- gem install asciidoctor-diagram
38-
install:
39-
- pip3 install pyyaml
40-
- pip3 install aura.tar.gz
4134
script:
4235
- python3 build.py --distro openshift-dedicated --product "OpenShift Dedicated" --version 4 --no-upstream-fetch && python3 makeBuild.py
36+
4337
- # stage name not required, will continue to use `build`
4438
if: branch IN (main, enterprise-4.13, enterprise-4.14)
4539
name: "Build openshift-rosa distro"
46-
before_install:
47-
- gem install asciidoctor
48-
- gem install asciidoctor-diagram
49-
install:
50-
- pip3 install pyyaml
51-
- pip3 install aura.tar.gz
5240
script:
5341
- python3 build.py --distro openshift-rosa --product "Red Hat OpenShift Service on AWS" --version 4 --no-upstream-fetch && python3 makeBuild.py
42+
5443
- # stage name not required, will continue to use `build`
5544
if: branch IN (main, enterprise-4.13, enterprise-4.14)
5645
name: "Build microshift distro"
57-
before_install:
58-
- gem install asciidoctor
59-
- gem install asciidoctor-diagram
60-
install:
61-
- pip3 install pyyaml
62-
- pip3 install aura.tar.gz
6346
script:
64-
- python3 build.py --distro microshift --product "MicroShift" --version 4 --no-upstream-fetch && python3 makeBuild.py
47+
- python3 build.py --distro microshift --product "Microshift" --version 4 --no-upstream-fetch && python3 makeBuild.py
48+
6549
# Remove Vale stage until PR commenting feature is ready
6650
# - stage: check-with-vale
6751
# env:
6852
# - CAN_FAIL=true
6953
# if: type IN (pull_request) AND sender != "openshift-cherrypick-robot"
7054
# name: "Run Vale against PR asciidoc files"
7155
# language: minimal
72-
# before_script:
73-
# - gem install asciidoctor
7456
# script:
7557
# - travis_retry wget https://github.com/errata-ai/vale/releases/download/v2.15.4/vale_2.15.4_Linux_64-bit.tar.gz --retry-connrefused
7658
# - mkdir bin && tar -xvzf vale_2.15.4_Linux_64-bit.tar.gz -C bin
7759
# - export PATH=./bin:"$PATH"
7860
# - travis_retry vale sync # pull down VRH rules package
7961
# - chmod +x ./scripts/check-with-vale.sh
80-
# - ./scripts/check-with-vale.sh
62+
# - ./scripts/check-with-vale.sh; fi
63+
8164
# Commenting out to disable auto-merging of PRs
8265
# - stage: automerge
8366
# if: env(PR_AUTHOR)=openshift-cherrypick-robot
8467
# script: bash ./automerge.sh
68+
8569
- stage: netlify
70+
name: "Build and deploy with Netlify"
8671
env:
8772
- CAN_FAIL=true
8873
language: minimal
8974
if: type IN (pull_request) AND branch IN (main, enterprise-4.13, enterprise-4.14) AND sender != "openshift-cherrypick-robot"
9075
script:
91-
- chmod +x autopreview.sh && ./autopreview.sh
76+
- chmod +x autopreview.sh
77+
- ./autopreview.sh
9278

9379
stages:
94-
- validate
80+
- cache-and-validate
9581
- build
9682
- netlify
9783
#- check-with-vale

requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
aura~=0.0.0
1+
./aura.tar.gz
22
lxml~=4.9.1
3-
PyYAML~=6.0
4-
requests~=2.28.1
3+
pyyaml~=6.0
4+
requests~=2.27.1

0 commit comments

Comments
 (0)