Skip to content

Commit a1bd3e6

Browse files
seismanweiji14
andauthored
CI: Simplify the step for downloading GMT cached files (#3227)
Co-authored-by: Wei Ji <[email protected]>
1 parent 63129e5 commit a1bd3e6

File tree

6 files changed

+13
-30
lines changed

6 files changed

+13
-30
lines changed

.github/workflows/benchmarks.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,8 @@ jobs:
6262
# Download cached remote files (artifacts) from GitHub
6363
- name: Download remote data from GitHub
6464
run: |
65-
gh run download -n gmt-cache -D gmt-cache
66-
# Move downloaded files to ~/.gmt directory and list them
67-
mkdir -p ~/.gmt
68-
mv gmt-cache/* ~/.gmt
69-
rmdir gmt-cache
65+
# Download cached files to ~/.gmt directory and list them
66+
gh run download --name gmt-cache --dir ~/.gmt/
7067
# Change modification times of the two files, so GMT won't refresh it
7168
touch ~/.gmt/gmt_data_server.txt ~/.gmt/gmt_hash_server.txt
7269
ls -lhR ~/.gmt

.github/workflows/ci_docs.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,8 @@ jobs:
113113
# Download cached remote files (artifacts) from GitHub
114114
- name: Download remote data from GitHub
115115
run: |
116-
gh run download -n gmt-cache -D gmt-cache
117-
# Move downloaded files to ~/.gmt directory and list them
118-
mkdir -p ~/.gmt
119-
mv gmt-cache/* ~/.gmt
120-
rmdir gmt-cache
116+
# Download cached files to ~/.gmt directory and list them
117+
gh run download --name gmt-cache --dir ~/.gmt/
121118
# Change modification times of the two files, so GMT won't refresh it
122119
touch ~/.gmt/gmt_data_server.txt ~/.gmt/gmt_hash_server.txt
123120
ls -lhR ~/.gmt

.github/workflows/ci_doctests.yaml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,8 @@ jobs:
7272
# Download cached remote files (artifacts) from GitHub
7373
- name: Download remote data from GitHub
7474
run: |
75-
gh run download -n gmt-cache -D gmt-cache
76-
# Move downloaded files to ~/.gmt directory and list them
77-
mkdir -p ~/.gmt
78-
mv gmt-cache/* ~/.gmt
79-
rmdir gmt-cache
75+
# Download cached files to ~/.gmt directory and list them
76+
gh run download --name gmt-cache --dir ~/.gmt/
8077
# Change modification times of the two files, so GMT won't refresh it
8178
touch ~/.gmt/gmt_data_server.txt ~/.gmt/gmt_hash_server.txt
8279
ls -lhR ~/.gmt

.github/workflows/ci_tests.yaml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,8 @@ jobs:
129129
# Download cached remote files (artifacts) from GitHub
130130
- name: Download remote data from GitHub
131131
run: |
132-
gh run download -n gmt-cache -D gmt-cache
133-
# Move downloaded files to ~/.gmt directory and list them
134-
mkdir -p ~/.gmt
135-
mv gmt-cache/* ~/.gmt
136-
rmdir gmt-cache
132+
# Download files to ~/.gmt directory and list them
133+
gh run download --name gmt-cache --dir ~/.gmt/
137134
# Change modification times of the two files, so GMT won't refresh it
138135
touch ~/.gmt/gmt_data_server.txt ~/.gmt/gmt_hash_server.txt
139136
ls -lhR ~/.gmt

.github/workflows/ci_tests_dev.yaml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,8 @@ jobs:
136136
# Download cached remote files (artifacts) from GitHub
137137
- name: Download remote data from GitHub
138138
run: |
139-
gh run download -n gmt-cache -D gmt-cache
140-
# Move downloaded files to ~/.gmt directory and list them
141-
mkdir -p ~/.gmt
142-
mv gmt-cache/* ~/.gmt
143-
rmdir gmt-cache
139+
# Download cached files to ~/.gmt directory and list them
140+
gh run download --name gmt-cache --dir ~/.gmt/
144141
# Change modification times of the two files, so GMT won't refresh it
145142
touch ~/.gmt/gmt_data_server.txt ~/.gmt/gmt_hash_server.txt
146143
ls -lhR ~/.gmt

.github/workflows/ci_tests_legacy.yaml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,12 @@ jobs:
8484
# Download cached remote files (artifacts) from GitHub
8585
- name: Download remote data from GitHub
8686
run: |
87-
gh run download -n gmt-cache -D gmt-cache
88-
# Move downloaded files to ~/.gmt directory and list them
89-
mkdir -p ~/.gmt
90-
mv gmt-cache/* ~/.gmt
91-
rmdir gmt-cache
87+
# Download cached files to ~/.gmt directory and list them
88+
gh run download --name gmt-cache --dir ~/.gmt/
9289
# Change modification times of the two files, so GMT won't refresh it
9390
# The two files are in the `~/.gmt/server` directory for GMT<=6.4, and
9491
# in the `~/.gmt` directory for GMT>=6.5.
92+
mkdir -p ~/.gmt/server/
9593
mv ~/.gmt/gmt_data_server.txt ~/.gmt/gmt_hash_server.txt ~/.gmt/server/
9694
touch ~/.gmt/server/gmt_data_server.txt ~/.gmt/server/gmt_hash_server.txt
9795
ls -lhR ~/.gmt

0 commit comments

Comments
 (0)