Skip to content

Commit 67fd7fe

Browse files
authored
ci: use environment variables for CDS API configuration (#456)
* ci: use environment variables for CDS API configuration * ci: skip codecov upload for scheduled jobs * revert: changes in `era5.py`
1 parent 1e6a0b8 commit 67fd7fe

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

.github/workflows/test.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,22 +53,21 @@ jobs:
5353
os: ${{ fromJSON(github.event_name == 'schedule' && '["ubuntu-latest"]' || '["ubuntu-latest","macos-latest","windows-latest"]') }}
5454
env:
5555
MPLBACKEND: Agg # https://github.com/orgs/community/discussions/26434
56+
CDSAPI_URL: ${{ vars.CDSAPI_URL }}
57+
CDSAPI_KEY: ${{ secrets.CDSAPI_TOKEN }}
5658

5759
steps:
5860
- name: Setup cache and secrets (Linux & MacOS)
5961
if: runner.os != 'Windows'
6062
run: |
6163
echo "CACHE_PATH=$HOME/.atlite_cache" >> $GITHUB_ENV
6264
echo "today=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
63-
echo -ne "url: ${{ vars.CDSAPI_URL }}\nkey: ${{ secrets.CDSAPI_TOKEN }}\n" > ~/.cdsapirc
6465
shell: bash
6566

6667
- name: Setup cache and secrets (Windows)
6768
if: runner.os == 'Windows'
6869
run: |
6970
echo CACHE_PATH=%USERPROFILE%\.atlite_cache >> %GITHUB_ENV%
70-
echo url: ${{ vars.CDSAPI_URL }} > %USERPROFILE%\.cdsapirc
71-
echo key: ${{ secrets.CDSAPI_TOKEN }} >> %USERPROFILE%\.cdsapirc
7271
for /f "tokens=2 delims==" %%a in ('"wmic os get localdatetime /value"') do set "today=%%a"
7372
set mydate=%today:~0,4%-%today:~4,2%-%today:~6,2%
7473
echo today=%mydate% >> %GITHUB_ENV%
@@ -116,6 +115,7 @@ jobs:
116115
return 0 # Ignore windows and pytest 3.13
117116
118117
- name: Upload code coverage report
118+
if: github.event_name != 'schedule'
119119
uses: codecov/codecov-action@v5
120120
with:
121121
token: ${{ secrets.CODECOV_TOKEN }}

0 commit comments

Comments
 (0)