Skip to content

Commit

Permalink
CI: Update concurrency, permissions and actions (#313)
Browse files Browse the repository at this point in the history
* CI: Add concurrency and permissions sections

* CI: Update cache versions, do not use old Python for flake8

* Update .github/workflows/pythonpackage.yml
  • Loading branch information
effigies authored Dec 6, 2022
1 parent 82e7593 commit 404fe3e
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 11 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/docs-build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,20 @@ on:
pull_request:
branches: [ master, 'maint/*' ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
build:
if: "(github.repository_owner != 'nipreps') && !contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0

Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/docs-build-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@ on:
branches: [ 'doc/*', 'docs/*', master, "maint/*" ]
tags: [ '*' ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
ssh-key: "${{ secrets.NIPREPS_DEPLOY }}"
fetch-depth: 0
Expand Down
21 changes: 14 additions & 7 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ on:
pull_request:
branches: [ master, 'maint/*' ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
build:
if: "!startsWith(github.ref, 'refs/tags/') && !contains(github.event.head_commit.message, '[skip ci]')"
Expand All @@ -20,15 +27,15 @@ jobs:
pip: ["pip==21.2", "pip~=22.0"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Fetch all tags (for setuptools_scm to work)
run: |
/usr/bin/git -c protocol.version=2 fetch --tags --prune --unshallow origin
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v1
- uses: actions/cache@v3
with:
path: $HOME/.cache/pip
key: pip-cache-v1
Expand Down Expand Up @@ -86,10 +93,10 @@ jobs:
flake8:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v1
- uses: actions/checkout@v3
- name: Set up Python 3
uses: actions/setup-python@v4
with:
python-version: 3.7
python-version: 3
- run: pip install flake8
- run: flake8 sdcflows/
11 changes: 9 additions & 2 deletions .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ on:
schedule:
- cron: 0 0 * * 0

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
build-linux:
if: "!contains(github.event.head_commit.message, '[skip ci]' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != 'nipreps/sdcflows'))"
Expand Down Expand Up @@ -81,7 +88,7 @@ jobs:
git config --global user.name 'NiPreps Bot'
git config --global user.email 'nipreps@gmail.com'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v3
Expand All @@ -97,7 +104,7 @@ jobs:
run: |
$CONDA/bin/conda install -c conda-forge git-annex datalad pip
$CONDA/bin/pip install datalad-osf
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install minimal dependencies
timeout-minutes: 5
run: |
Expand Down

0 comments on commit 404fe3e

Please sign in to comment.