Skip to content

Commit 684e208

Browse files
committed
Added s3 cache sync
1 parent 7d31a75 commit 684e208

File tree

1 file changed

+32
-8
lines changed

1 file changed

+32
-8
lines changed

.travis.yml

+32-8
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,50 @@
11
language: python
22
python:
33
- '3.9'
4-
install: pip install -r requirements.txt
4+
install:
5+
- pip install -r requirements.txt
6+
- pip install awscli
57
script:
68
jobs:
79
include:
810
# Each step caches fetched problems from the previous one
911
# so the next one runs faster.
1012
# This is a hack because travis CI has a time limit of 30
1113
# minutes for each individual job
12-
- stage: 0 to 500
13-
script: python generate.py --start 0 --stop 500
14+
- stage: 0 to 2 (test run)
15+
script:
16+
- python generate.py --start 0 --stop 2
17+
- aws s3 sync cache s3://github-prius-travis-ci-us-east-1/leetcode-anki-$TRAVIS_BUILD_NUMBER
18+
- stage: 2 to 500
19+
script:
20+
- aws s3 sync s3://github-prius-travis-ci-us-east-1/leetcode-anki-$TRAVIS_BUILD_NUMBER cache
21+
- python generate.py --start 0 --stop 500
22+
- aws s3 sync cache s3://github-prius-travis-ci-us-east-1/leetcode-anki-$TRAVIS_BUILD_NUMBER
1423
- stage: 500 to 1000
15-
script: python generate.py --start 0 --stop 1000
24+
script:
25+
- aws s3 sync s3://github-prius-travis-ci-us-east-1/leetcode-anki-$TRAVIS_BUILD_NUMBER cache
26+
- python generate.py --start 0 --stop 1000
27+
- aws s3 sync cache s3://github-prius-travis-ci-us-east-1/leetcode-anki-$TRAVIS_BUILD_NUMBER
1628
- stage: 1000 to 1500
17-
script: python generate.py --start 0 --stop 1500
29+
script:
30+
- aws s3 sync s3://github-prius-travis-ci-us-east-1/leetcode-anki-$TRAVIS_BUILD_NUMBER cache
31+
- python generate.py --start 0 --stop 1500
32+
- aws s3 sync cache s3://github-prius-travis-ci-us-east-1/leetcode-anki-$TRAVIS_BUILD_NUMBER
1833
- stage: 1500 to 2000
19-
script: python generate.py --start 0 --stop 2000
34+
script:
35+
- aws s3 sync s3://github-prius-travis-ci-us-east-1/leetcode-anki-$TRAVIS_BUILD_NUMBER cache
36+
- python generate.py --start 0 --stop 2000
37+
- aws s3 sync cache s3://github-prius-travis-ci-us-east-1/leetcode-anki-$TRAVIS_BUILD_NUMBER
2038
- stage: 2000 to 2500
21-
script: python generate.py --start 0 --stop 2500
39+
script:
40+
- aws s3 sync s3://github-prius-travis-ci-us-east-1/leetcode-anki-$TRAVIS_BUILD_NUMBER cache
41+
- python generate.py --start 0 --stop 2500
42+
- aws s3 sync cache s3://github-prius-travis-ci-us-east-1/leetcode-anki-$TRAVIS_BUILD_NUMBER
2243
- stage: 2500 to 3000
23-
script: python generate.py --start 0 --stop 3000
44+
script:
45+
- aws s3 sync s3://github-prius-travis-ci-us-east-1/leetcode-anki-$TRAVIS_BUILD_NUMBER cache
46+
- python generate.py --start 0 --stop 3000
47+
- aws s3 rm --recursive s3://github-prius-travis-ci-us-east-1/leetcode-anki-$TRAVIS_BUILD_NUMBER
2448
deploy:
2549
provider: releases
2650
api_key: $GITHUB_TOKEN

0 commit comments

Comments
 (0)