Skip to content

Commit cf53bcb

Browse files
committed
Change check-netlogo to be OS independent
1 parent a566e12 commit cf53bcb

6 files changed

Lines changed: 31 additions & 24 deletions

File tree

.github/workflows/run-experiment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ on:
22
push:
33
branches: [main, master]
44

5-
name: Run BehaviorSpace experiments
5+
name: run-experiment.yaml
66
permissions: read-all
77

88
jobs:

.github/workflows/run-logolink.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ on:
22
push:
33
branches: [main, master]
44

5-
name: Run experiments with Quarto and logolink
5+
name: run-logolink.yaml
66
permissions: read-all
77

88
jobs:
99
run-logolink:
10-
name: Run experiments
10+
name: Run experiments with Quarto and logolink
1111
runs-on: ubuntu-latest
1212
env:
1313
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}

.github/workflows/test-setup-netlogo.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ permissions: read-all
88
jobs:
99
test-setup-netlogo:
1010
strategy:
11+
fail-fast: false
1112
matrix:
1213
config:
13-
- {os: macos-latest, version: 'release'}
1414
- {os: windows-latest, version: '6.4.0'}
1515
- {os: windows-latest, version: 'release'}
16+
- {os: macos-latest, version: 'release'}
1617
- {os: ubuntu-latest, version: '6.4.0'}
1718
- {os: ubuntu-latest, version: 'release'}
1819
cache: ['false', 'true']

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"behaviorsearch",
2727
"Behaviorspace",
2828
"cffr",
29+
"choco",
2930
"Clim",
3031
"cnpq",
3132
"compgen",

check-netlogo/action.yaml

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ description: |
55
BehaviorSpace experiments found in those models using the NetLogo headless
66
API. It requires the repository to be checked out (via `actions/checkout@v*`)
77
and NetLogo to be available on the runner (via
8-
`danielvartan/logoactions/setup-netlogo@v*`). Only `ubuntu-latest`
9-
runners are supported.
8+
`danielvartan/logoactions/setup-netlogo@v*`).
109
1110
The action automatically selects the appropriate file extensions based on the
1211
installed NetLogo version: `.nlogo` and `.nlogo3d` for NetLogo 6 and earlier,
@@ -28,18 +27,6 @@ inputs:
2827
runs:
2928
using: composite
3029
steps:
31-
- name: Check OS compatibility
32-
run: |
33-
# Check OS compatibility
34-
# set -x
35-
36-
if [[ ${RUNNER_OS} != "Linux" ]]; then
37-
echo "Error: This action only supports Linux runners."
38-
39-
exit 1
40-
fi
41-
shell: bash
42-
4330
- name: Validate arguments
4431
run: |
4532
# Validate arguments
@@ -56,21 +43,39 @@ runs:
5643
fi
5744
shell: bash
5845

59-
- name: Install dependencies
46+
- name: Install dependencies (Linux)
47+
if: runner.os == 'Linux'
6048
run: |
61-
# Install dependencies
49+
# Install dependencies (Linux)
6250
# set -x
6351
6452
sudo apt-get update -qq >/dev/null
6553
sudo apt-get install -y -qq ripgrep >/dev/null
6654
shell: bash
6755

56+
- name: Install dependencies (macOS)
57+
if: runner.os == 'macOS'
58+
run: |
59+
# Install dependencies (macOS)
60+
# set -x
61+
62+
brew install ripgrep
63+
shell: bash
64+
65+
- name: Install dependencies (Windows)
66+
if: runner.os == 'Windows'
67+
run: |
68+
# Install dependencies (Windows)
69+
70+
choco install ripgrep -y
71+
shell: pwsh
72+
6873
- name: Create artifacts directory
6974
run: |
7075
# Create artifacts directory
7176
# set -x
7277
73-
mkdir -p /tmp/check-netlogo
78+
mkdir -p "${RUNNER_TEMP}/check-netlogo"
7479
shell: bash
7580

7681
- name: Search for NetLogo models
@@ -166,7 +171,7 @@ runs:
166171
167172
output_file=$( \
168173
printf "%s/%s_%s.csv" \
169-
"/tmp/check-netlogo" \
174+
"${RUNNER_TEMP}/check-netlogo" \
170175
"${sanitized_model_name}" \
171176
"${sanitized_experiment_name}" \
172177
)
@@ -181,7 +186,7 @@ runs:
181186
done
182187
183188
shopt -s nullglob
184-
files=(/tmp/check-netlogo/*.csv)
189+
files=("${RUNNER_TEMP}"/check-netlogo/*.csv)
185190
186191
if [[ ${#files[@]} -gt 0 ]]; then
187192
echo "found=true" >> "${GITHUB_OUTPUT}"
@@ -202,6 +207,6 @@ runs:
202207
uses: actions/upload-artifact@v4
203208
with:
204209
name: experiments-output
205-
path: '/tmp/check-netlogo/'
210+
path: "${{runner.temp}}/check-netlogo/"
206211
retention-days: 90
207212
if-no-files-found: warn

images/logo.png

90.3 KB
Loading

0 commit comments

Comments
 (0)