Skip to content

Commit 404fe3e

Browse files
authored
CI: Update concurrency, permissions and actions (#313)
* CI: Add concurrency and permissions sections * CI: Update cache versions, do not use old Python for flake8 * Update .github/workflows/pythonpackage.yml
1 parent 82e7593 commit 404fe3e

File tree

4 files changed

+36
-11
lines changed

4 files changed

+36
-11
lines changed

.github/workflows/docs-build-pr.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,20 @@ on:
55
pull_request:
66
branches: [ master, 'maint/*' ]
77

8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
permissions:
13+
contents: read
14+
815
jobs:
916
build:
1017
if: "(github.repository_owner != 'nipreps') && !contains(github.event.head_commit.message, '[skip ci]')"
1118
runs-on: ubuntu-latest
1219

1320
steps:
14-
- uses: actions/checkout@v2
21+
- uses: actions/checkout@v3
1522
with:
1623
fetch-depth: 0
1724

.github/workflows/docs-build-update.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,16 @@ on:
66
branches: [ 'doc/*', 'docs/*', master, "maint/*" ]
77
tags: [ '*' ]
88

9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
913
jobs:
1014
build:
1115
runs-on: ubuntu-latest
1216

1317
steps:
14-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v3
1519
with:
1620
ssh-key: "${{ secrets.NIPREPS_DEPLOY }}"
1721
fetch-depth: 0

.github/workflows/pythonpackage.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ on:
1010
pull_request:
1111
branches: [ master, 'maint/*' ]
1212

13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
permissions:
18+
contents: read
19+
1320
jobs:
1421
build:
1522
if: "!startsWith(github.ref, 'refs/tags/') && !contains(github.event.head_commit.message, '[skip ci]')"
@@ -20,15 +27,15 @@ jobs:
2027
pip: ["pip==21.2", "pip~=22.0"]
2128

2229
steps:
23-
- uses: actions/checkout@v2
30+
- uses: actions/checkout@v3
2431
- name: Fetch all tags (for setuptools_scm to work)
2532
run: |
2633
/usr/bin/git -c protocol.version=2 fetch --tags --prune --unshallow origin
2734
- name: Set up Python ${{ matrix.python-version }}
28-
uses: actions/setup-python@v2
35+
uses: actions/setup-python@v4
2936
with:
3037
python-version: ${{ matrix.python-version }}
31-
- uses: actions/cache@v1
38+
- uses: actions/cache@v3
3239
with:
3340
path: $HOME/.cache/pip
3441
key: pip-cache-v1
@@ -86,10 +93,10 @@ jobs:
8693
flake8:
8794
runs-on: ubuntu-latest
8895
steps:
89-
- uses: actions/checkout@v2
90-
- name: Set up Python 3.7
91-
uses: actions/setup-python@v1
96+
- uses: actions/checkout@v3
97+
- name: Set up Python 3
98+
uses: actions/setup-python@v4
9299
with:
93-
python-version: 3.7
100+
python-version: 3
94101
- run: pip install flake8
95102
- run: flake8 sdcflows/

.github/workflows/unittests.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ on:
66
schedule:
77
- cron: 0 0 * * 0
88

9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
permissions:
14+
contents: read
15+
916
jobs:
1017
build-linux:
1118
if: "!contains(github.event.head_commit.message, '[skip ci]' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != 'nipreps/sdcflows'))"
@@ -81,7 +88,7 @@ jobs:
8188
git config --global user.name 'NiPreps Bot'
8289
git config --global user.email '[email protected]'
8390
- name: Set up Python ${{ matrix.python-version }}
84-
uses: actions/setup-python@v2
91+
uses: actions/setup-python@v4
8592
with:
8693
python-version: ${{ matrix.python-version }}
8794
- uses: actions/cache@v3
@@ -97,7 +104,7 @@ jobs:
97104
run: |
98105
$CONDA/bin/conda install -c conda-forge git-annex datalad pip
99106
$CONDA/bin/pip install datalad-osf
100-
- uses: actions/checkout@v2
107+
- uses: actions/checkout@v3
101108
- name: Install minimal dependencies
102109
timeout-minutes: 5
103110
run: |

0 commit comments

Comments
 (0)