Skip to content

Commit 4786110

Browse files
authored
CI: Use 'gh run download' to download GMT cache artifacts (#3188)
Removes the need for the 'dawidd6/action-download-artifact' GitHub Action.
1 parent d844fd1 commit 4786110

File tree

6 files changed

+36
-60
lines changed

6 files changed

+36
-60
lines changed

.github/workflows/benchmarks.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,21 +64,17 @@ jobs:
6464
6565
# Download cached remote files (artifacts) from GitHub
6666
- name: Download remote data from GitHub
67-
uses: dawidd6/action-download-artifact@v3.1.4
68-
with:
69-
workflow: cache_data.yaml
70-
workflow_conclusion: success
71-
name: gmt-cache
72-
path: .gmt
73-
74-
# Move downloaded files to ~/.gmt directory and list them
75-
- name: Move and list downloaded remote files
7667
run: |
68+
gh run download -n gmt-cache -D gmt-cache
69+
# Move downloaded files to ~/.gmt directory and list them
7770
mkdir -p ~/.gmt
78-
mv .gmt/* ~/.gmt
71+
mv gmt-cache/* ~/.gmt
72+
rmdir gmt-cache
7973
# Change modification times of the two files, so GMT won't refresh it
8074
touch ~/.gmt/gmt_data_server.txt ~/.gmt/gmt_hash_server.txt
8175
ls -lhR ~/.gmt
76+
env:
77+
GH_TOKEN: ${{ github.token }}
8278

8379
# Install the package that we want to test
8480
- name: Install the package

.github/workflows/ci_docs.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -112,21 +112,17 @@ jobs:
112112
113113
# Download cached remote files (artifacts) from GitHub
114114
- name: Download remote data from GitHub
115-
uses: dawidd6/action-download-artifact@v3.1.4
116-
with:
117-
workflow: cache_data.yaml
118-
workflow_conclusion: success
119-
name: gmt-cache
120-
path: .gmt
121-
122-
# Move downloaded files to ~/.gmt directory and list them
123-
- name: Move and list downloaded remote files
124115
run: |
116+
gh run download -n gmt-cache -D gmt-cache
117+
# Move downloaded files to ~/.gmt directory and list them
125118
mkdir -p ~/.gmt
126-
mv .gmt/* ~/.gmt
119+
mv gmt-cache/* ~/.gmt
120+
rmdir gmt-cache
127121
# Change modification times of the two files, so GMT won't refresh it
128122
touch ~/.gmt/gmt_data_server.txt ~/.gmt/gmt_hash_server.txt
129123
ls -lhR ~/.gmt
124+
env:
125+
GH_TOKEN: ${{ github.token }}
130126

131127
# Install the package that we want to test
132128
- name: Install the package

.github/workflows/ci_doctests.yaml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,21 +71,17 @@ jobs:
7171
7272
# Download cached remote files (artifacts) from GitHub
7373
- name: Download remote data from GitHub
74-
uses: dawidd6/action-download-artifact@v3.1.4
75-
with:
76-
workflow: cache_data.yaml
77-
workflow_conclusion: success
78-
name: gmt-cache
79-
path: .gmt
80-
81-
# Move downloaded files to ~/.gmt directory and list them
82-
- name: Move and list downloaded remote files
8374
run: |
75+
gh run download -n gmt-cache -D gmt-cache
76+
# Move downloaded files to ~/.gmt directory and list them
8477
mkdir -p ~/.gmt
85-
mv .gmt/* ~/.gmt
78+
mv gmt-cache/* ~/.gmt
79+
rmdir gmt-cache
8680
# Change modification times of the two files, so GMT won't refresh it
8781
touch ~/.gmt/gmt_data_server.txt ~/.gmt/gmt_hash_server.txt
8882
ls -lhR ~/.gmt
83+
env:
84+
GH_TOKEN: ${{ github.token }}
8985

9086
# Install the package that we want to test
9187
- name: Install the package

.github/workflows/ci_tests.yaml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -128,21 +128,17 @@ jobs:
128128
129129
# Download cached remote files (artifacts) from GitHub
130130
- name: Download remote data from GitHub
131-
uses: dawidd6/action-download-artifact@v3.1.4
132-
with:
133-
workflow: cache_data.yaml
134-
workflow_conclusion: success
135-
name: gmt-cache
136-
path: .gmt
137-
138-
# Move downloaded files to ~/.gmt directory and list them
139-
- name: Move and list downloaded remote files
140131
run: |
132+
gh run download -n gmt-cache -D gmt-cache
133+
# Move downloaded files to ~/.gmt directory and list them
141134
mkdir -p ~/.gmt
142-
mv .gmt/* ~/.gmt
135+
mv gmt-cache/* ~/.gmt
136+
rmdir gmt-cache
143137
# Change modification times of the two files, so GMT won't refresh it
144138
touch ~/.gmt/gmt_data_server.txt ~/.gmt/gmt_hash_server.txt
145139
ls -lhR ~/.gmt
140+
env:
141+
GH_TOKEN: ${{ github.token }}
146142

147143
# Pull baseline image data from dvc remote (DAGsHub)
148144
- name: Pull baseline image data from dvc remote

.github/workflows/ci_tests_dev.yaml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -135,21 +135,17 @@ jobs:
135135

136136
# Download cached remote files (artifacts) from GitHub
137137
- name: Download remote data from GitHub
138-
uses: dawidd6/action-download-artifact@v3.1.4
139-
with:
140-
workflow: cache_data.yaml
141-
workflow_conclusion: success
142-
name: gmt-cache
143-
path: .gmt
144-
145-
# Move downloaded files to ~/.gmt directory and list them
146-
- name: Move and list downloaded remote files
147138
run: |
139+
gh run download -n gmt-cache -D gmt-cache
140+
# Move downloaded files to ~/.gmt directory and list them
148141
mkdir -p ~/.gmt
149-
mv .gmt/* ~/.gmt
142+
mv gmt-cache/* ~/.gmt
143+
rmdir gmt-cache
150144
# Change modification times of the two files, so GMT won't refresh it
151145
touch ~/.gmt/gmt_data_server.txt ~/.gmt/gmt_hash_server.txt
152146
ls -lhR ~/.gmt
147+
env:
148+
GH_TOKEN: ${{ github.token }}
153149

154150
# Install the package that we want to test
155151
- name: Install the package

.github/workflows/ci_tests_legacy.yaml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -83,24 +83,20 @@ jobs:
8383
8484
# Download cached remote files (artifacts) from GitHub
8585
- name: Download remote data from GitHub
86-
uses: dawidd6/action-download-artifact@v3.1.4
87-
with:
88-
workflow: cache_data.yaml
89-
workflow_conclusion: success
90-
name: gmt-cache
91-
path: .gmt
92-
93-
# Move downloaded files to ~/.gmt directory and list them
94-
- name: Move and list downloaded remote files
9586
run: |
87+
gh run download -n gmt-cache -D gmt-cache
88+
# Move downloaded files to ~/.gmt directory and list them
9689
mkdir -p ~/.gmt
97-
mv .gmt/* ~/.gmt
90+
mv gmt-cache/* ~/.gmt
91+
rmdir gmt-cache
9892
# Change modification times of the two files, so GMT won't refresh it
9993
# The two files are in the `~/.gmt/server` directory for GMT<=6.4, and
10094
# in the `~/.gmt` directory for GMT>=6.5.
10195
mv ~/.gmt/gmt_data_server.txt ~/.gmt/gmt_hash_server.txt ~/.gmt/server/
10296
touch ~/.gmt/server/gmt_data_server.txt ~/.gmt/server/gmt_hash_server.txt
10397
ls -lhR ~/.gmt
98+
env:
99+
GH_TOKEN: ${{ github.token }}
104100

105101
# Install the package that we want to test
106102
- name: Install the package

0 commit comments

Comments
 (0)