Skip to content

Commit 80b699d

Browse files
authored
Set bash to be default shell for Github Actions CI (#1037)
Shaves a few lines off the .github/workflows/*.yaml files. See https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#defaultsrun.
1 parent 0bb0500 commit 80b699d

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

.github/workflows/cache_data.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ jobs:
1212
gmt_cache:
1313
name: Cache GMT artifacts
1414
runs-on: macOS-latest
15+
defaults:
16+
run:
17+
shell: bash -l {0}
1518

1619
steps:
1720
# Setup Miniconda
@@ -23,21 +26,19 @@ jobs:
2326

2427
# Install GMT
2528
- name: Install GMT
26-
shell: bash -l {0}
2729
run: conda install -c conda-forge gmt=6.1.1
2830

2931
# Download remote files
3032
- name: Download remote data
31-
shell: bash -l {0}
3233
run: |
3334
gmt which -Ga @earth_relief_10m_p @earth_relief_10m_g \
3435
@earth_relief_30m_p @earth_relief_30m_g \
3536
@earth_relief_01d_p @earth_relief_01d_g \
3637
@earth_relief_05m_p @earth_relief_05m_g
3738
# Download one tile of the 03s srtm data.
3839
# @N35E135.earth_relief_03s_g.nc is for internal use only.
39-
# The naming scheme may change.
40-
# DO NOT USE IT IN SCRIPTS.
40+
# The naming scheme may change.
41+
# DO NOT USE IT IN SCRIPTS.
4142
gmt which -Ga @N35E135.earth_relief_03s_g.nc
4243
gmt which -Ga @ridge.txt @Table_5_11.txt @test.dat.nc \
4344
@tut_bathy.nc @tut_quakes.ngdc @tut_ship.xyz \

.github/workflows/ci_tests.yaml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ jobs:
4545
- os: ubuntu-latest
4646
python-version: 3.8
4747
isDraft: true
48+
defaults:
49+
run:
50+
shell: bash -l {0}
4851

4952
# environmental variables used in coverage
5053
env:
@@ -76,12 +79,10 @@ jobs:
7679

7780
# Install GMT and other required dependencies from conda-forge
7881
- name: Install dependencies
79-
shell: bash -l {0}
8082
run: conda env update --file environment.yml
8183

8284
# Show installed pkg information for postmortem diagnostic
8385
- name: List installed packages
84-
shell: bash -l {0}
8586
run: conda list
8687

8788
# Download cached remote files (artifacts) from GitHub
@@ -95,7 +96,6 @@ jobs:
9596

9697
# Move downloaded files to ~/.gmt directory and list them
9798
- name: Move and list downloaded remote files
98-
shell: bash -l {0}
9999
run: |
100100
mkdir -p ~/.gmt
101101
mv .gmt/* ~/.gmt
@@ -105,14 +105,12 @@ jobs:
105105
106106
# Install the package that we want to test
107107
- name: Install the package
108-
shell: bash -l {0}
109108
run: |
110109
python setup.py sdist --formats=zip
111110
pip install dist/*
112111
113112
# Run the tests
114113
- name: Test with pytest
115-
shell: bash -l {0}
116114
run: make test PYTEST_EXTRA="-r P"
117115

118116
# Upload diff images on test failure
@@ -125,7 +123,6 @@ jobs:
125123

126124
# Build the documentation
127125
- name: Build the documentation
128-
shell: bash -l {0}
129126
run: make -C doc clean all
130127

131128
# Upload coverage to Codecov

.github/workflows/ci_tests_dev.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ jobs:
106106

107107
# Move downloaded files to ~/.gmt directory and list them
108108
- name: Move and list downloaded remote files
109-
shell: bash -l {0}
110109
run: |
111110
mkdir -p ~/.gmt
112111
mv .gmt/* ~/.gmt

0 commit comments

Comments
 (0)