forked from NetLogo/NetLogo
-
Notifications
You must be signed in to change notification settings - Fork 0
121 lines (103 loc) · 3.2 KB
/
Copy pathmain.yml
File metadata and controls
121 lines (103 loc) · 3.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
name: build-and-test
on:
push:
pull_request:
workflow_dispatch:
env:
liberica-version: '17.0'
jobs:
build:
runs-on: ubuntu-latest
if: ${{ 'pull_request' != github.event_name || (github.event.pull_request.head.repo.git_url != github.event.pull_request.base.repo.git_url) }}
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v4
# This setting can be re-added and the `Clone Git submoudles` step removed when this bug is fixed and released:
# https://github.com/actions/checkout/issues/994 -Jeremy B April 2023
# with:
# submodules: true
- name: Clone Git submodules
run: git submodule update --init
- uses: actions/setup-java@v4
with:
distribution: 'liberica'
java-version: ${{ env.liberica-version }}
java-package: jdk+fx
cache: 'sbt'
- uses: sbt/setup-sbt@v1
- name: Build NetLogo
run: |
./sbt update all headless/compile parserJS/compile
- uses: actions/cache@v4
id: restore-build
with:
path: ./*
key: ${{ github.sha }}
# Kept separate from the test matrix just to avoid installing the python stuff.
# There might be a better/cleverer way to handle it, but this is fine for now.
test-extensions:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/cache@v4
id: restore-build
with:
path: ./*
key: ${{ github.sha }}
- uses: actions/setup-java@v4
with:
distribution: 'liberica'
java-version: ${{ env.liberica-version }}
java-package: jdk+fx
cache: 'sbt'
- uses: actions/setup-python@v5
with:
python-version: '3.9'
# The Python stuff is just for testing the Python extension, it's not part of NetLogo's build process.
- name: Install Dependencies
run: |
pip3 install numpy
pip3 install scikit-learn
- name: Test Extensions
run: ./sbt netlogo/Test/extensionTests
test:
runs-on: ubuntu-latest
needs: build
strategy:
fail-fast: false
matrix:
test: [
"parserJS/test; parserJVM/test"
, "depend"
, "headless/depend"
, "netlogo/Test/fast"
, "netlogo/Test/medium"
, "netlogo/Test/slow"
, "nogen; netlogo/Test/fast"
, "nogen; netlogo/Test/medium"
, "threed; netlogo/Test/fast"
, "threed; netlogo/Test/medium"
, "threed; netlogo/Test/slow"
, "headless/Test/fast"
, "headless/Test/medium"
, "headless/Test/slow"
, "nogen; headless/Test/fast"
, "nogen; headless/Test/medium"
]
steps:
- uses: actions/cache@v4
id: restore-build
with:
path: ./*
key: ${{ github.sha }}
- uses: actions/setup-java@v4
with:
distribution: 'liberica'
java-version: ${{ env.liberica-version }}
java-package: jdk+fx
cache: 'sbt'
- name: ${{ matrix.test }}
run: ./sbt "${{ matrix.test }}"