-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.cirrus.yml
55 lines (49 loc) · 1.7 KB
/
.cirrus.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Global default environment
container:
image: python:slim
# Templates for reuse
install_git_script_template: &INSTALL_GIT_SCRIPT
install_git_script:
- apt-get update
- apt-get upgrade -y
- apt-get install -y git
pip_cache_template: &PIP_CACHE
pip_cache:
folder: ~/.cache/pip
fingerprint_script: echo $PYTHON_VERSION && cat requirements.txt
populate_script: pip install -r requirements.txt
# Tasks
task:
name: Build and Run
<< : *INSTALL_GIT_SCRIPT
<< : *PIP_CACHE
pip_install_script: pip install -r requirements.txt
fetch_git_tags_script: git fetch --tags
install_script: python setup.py install
version_script: self-updating-app --version
test_script: self-updating-app --no-update
task:
# Test without cloning the repo first
name: Test Install from GitHub
# Only run for Releases and Pull Requests
only_if: $CIRRUS_RELEASE != "" || $CIRRUS_PR != ""
# Override clone script to be empty
clone_script: echo "noop"
<< : *INSTALL_GIT_SCRIPT
install_script: pip install git+${CIRRUS_REPO_CLONE_URL}@${CIRRUS_CHANGE_IN_REPO}
run_script: self-updating-app --version
task:
name: Test Install from GitHub and Check Version
# Only run for Releases
only_if: $CIRRUS_RELEASE != ""
<< : *INSTALL_GIT_SCRIPT
<< : *PIP_CACHE
install_script: python scripts/ci/install_latest_from_github.py $CIRRUS_REPO_CLONE_URL $CIRRUS_TAG
task:
name: Install Previous Version and Self-Update
# Only run for Releases
only_if: $CIRRUS_RELEASE != ""
<< : *INSTALL_GIT_SCRIPT
<< : *PIP_CACHE
pip_install_script: pip install -r requirements.txt
install_previous_and_self_update_script: python scripts/ci/install_second_latest_and_update.py $CIRRUS_REPO_FULL_NAME $CIRRUS_TAG