Skip to content

Commit fdbb828

Browse files
committed
Update GitHub Actions workflows and add actionlint CI
- Update GitHub Actions to latest versions (checkout v4, setup-python v5, github-script v7) - Fix shellcheck warnings (proper quoting, escaping) - Add actionlint workflow for automated workflow validation - Remove unnecessary matrix.python-version references in job names
1 parent dd9fb59 commit fdbb828

File tree

3 files changed

+43
-18
lines changed

3 files changed

+43
-18
lines changed

.github/workflows/actionlint.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Lint GitHub Actions workflows
2+
3+
on:
4+
push:
5+
paths:
6+
- '.github/workflows/**'
7+
pull_request:
8+
paths:
9+
- '.github/workflows/**'
10+
11+
jobs:
12+
actionlint:
13+
name: Actionlint
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout Repository
17+
uses: actions/checkout@v4
18+
19+
- name: Download actionlint
20+
run: |
21+
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.sh)
22+
echo "$PWD" >> $GITHUB_PATH
23+
24+
- name: Check workflow files
25+
run: actionlint

.github/workflows/release.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323

2424
- name: Get PR labels
2525
id: get_labels
26-
uses: actions/github-script@v6
26+
uses: actions/github-script@v7
2727
with:
2828
script: |
2929
const prs = context.payload.workflow_run.pull_requests;
@@ -69,7 +69,7 @@ jobs:
6969
token: ${{ secrets.GITHUB_TOKEN }}
7070

7171
- name: Set up Python
72-
uses: actions/setup-python@v4
72+
uses: actions/setup-python@v5
7373
with:
7474
python-version: '3.9'
7575

@@ -89,14 +89,14 @@ jobs:
8989
- name: Install package
9090
run: |
9191
python -m pip install --upgrade pip setuptools wheel
92-
pip install .[all]
92+
pip install .\[all\]
9393
9494
- name: Get version from package
9595
id: get_version
9696
run: |
9797
VERSION=$(python -c "import skrobot; print(skrobot.__version__)")
9898
echo "Detected version: $VERSION"
99-
echo "version=$VERSION" >> $GITHUB_OUTPUT
99+
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
100100
101101
- name: Tag and push release
102102
run: |
@@ -114,7 +114,7 @@ jobs:
114114
fetch-depth: 0
115115
token: ${{ secrets.GITHUB_TOKEN }}
116116
- name: Set up Python
117-
uses: actions/setup-python@v4
117+
uses: actions/setup-python@v5
118118
with:
119119
python-version: '3.x'
120120
- name: Install publishing dependencies

.github/workflows/test.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ jobs:
1616
name: Check Formatting
1717
runs-on: ubuntu-latest
1818
steps:
19-
- uses: actions/checkout@v3
20-
- name: Set up Python ${{ matrix.python-version }}
21-
uses: actions/setup-python@v4
19+
- uses: actions/checkout@v4
20+
- name: Set up Python
21+
uses: actions/setup-python@v5
2222
with:
2323
python-version: 3.8
2424
- name: Install Formatting
@@ -46,15 +46,15 @@ jobs:
4646
name: Build Sphinx Documentation
4747
runs-on: ubuntu-latest
4848
steps:
49-
- uses: actions/checkout@v3
50-
- name: Set up Python ${{ matrix.python-version }}
51-
uses: actions/setup-python@v4
49+
- uses: actions/checkout@v4
50+
- name: Set up Python
51+
uses: actions/setup-python@v5
5252
with:
5353
python-version: 3.11
5454
- name: Install dependencies
5555
run: |
5656
python -m pip install --upgrade pip
57-
pip install --no-cache-dir .[all]
57+
pip install --no-cache-dir .\[all\]
5858
- name: Build Sphinx Documentation
5959
working-directory: ./docs/source
6060
run: |
@@ -65,7 +65,7 @@ jobs:
6565
name: Check Requirements Formatting
6666
runs-on: ubuntu-latest
6767
steps:
68-
- uses: actions/checkout@v3
68+
- uses: actions/checkout@v4
6969
- name: Check Formatting
7070
run: |
7171
sort -C requirements.txt
@@ -156,9 +156,9 @@ jobs:
156156
remove-setuptools: true # <- this one uses the latest setuptools
157157
fail-fast: false
158158
steps:
159-
- uses: actions/checkout@v3
160-
- name: Set up Python ${{ matrix.python-version }}
161-
uses: actions/setup-python@v2
159+
- uses: actions/checkout@v4
160+
- name: Set up Python
161+
uses: actions/setup-python@v5
162162
with:
163163
python-version: ${{ matrix.python-version }}
164164
- name: Wait for apt-get lock
@@ -180,7 +180,7 @@ jobs:
180180
- name: Install scikit-robot
181181
run: |
182182
pip cache purge
183-
pip install --no-cache-dir .[all]
183+
pip install --no-cache-dir .\[all\]
184184
185185
- name: Install NumPy and SciPy
186186
run: |
@@ -211,7 +211,7 @@ jobs:
211211
break
212212
else
213213
echo "Tests failed on attempt $i"
214-
if [ $i -eq 3 ]; then
214+
if [ "$i" -eq 3 ]; then
215215
echo "All retry attempts failed"
216216
exit 1
217217
fi

0 commit comments

Comments
 (0)