-
Notifications
You must be signed in to change notification settings - Fork 7
316 lines (292 loc) · 10.9 KB
/
aries.yml
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
name: Aries
on: push
env:
CARGO_TERM_COLOR: always
jobs:
unit-tests:
name: Unit tests
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: dtolnay/rust-toolchain@stable
- run: cargo test
lints:
name: Rustfmt and Clippy
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: dtolnay/[email protected] # fixed version to avoid failures on rust version releases
with:
components: clippy, rustfmt
- run: cargo fmt --all -- --check
- run: cargo clippy -- -D warnings
integration-tests:
name: Solving
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: dtolnay/rust-toolchain@stable
- name: Install GNU parallel
run: sudo apt-get update && sudo apt-get install parallel
- name: Get problems from LFS
run: git lfs pull
- name: SAT solving
run: ./ci/sat.py debug
- name: Scheduler testing
run: ./ci/scheduling.py
- name: GG solving
run: ./ci/gg.py
- name: LCP Solving (PDDL & HDDL)
run: ./ci/lcp.sh
unified-planning-api:
name: Unified Planning API
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: dtolnay/rust-toolchain@stable
- name: Check for new protobuf definitions
run: |
# Download the latest protobuf definitions
printf "Checking for new protobuf definitions...\n"
git submodule update --init # get our own copy of unified-planning library
cd planning
rm grpc/api/src/unified_planning.proto
cp unified/deps/unified-planning/unified_planning/grpc/unified_planning.proto grpc/api/src/
git diff --exit-code
- name: Install Protobuf
run: sudo apt-get update && sudo apt-get install -y libprotobuf-dev protobuf-compiler
- name: Check if generated bindings are up to date
run: |
printf "Checking if the API is up to date...\n"
cd planning/grpc/api
cargo build --features=generate_bindings
cd ../../..
git diff --exit-code
unified-planning-integration:
name: UP Integration Tests
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- name: Submodules initialization
run: git submodule update --init # get our own copy of unified-planing repos
- name: Install python dependencies
run: python3 -m pip install -r planning/unified/requirements.txt "numpy<2"
- name: Validator tests
run: |
source planning/unified/dev.env
python3 planning/unified/deps/unified-planning/up_test_cases/report.py aries-val
- name: Solver tests
run: |
source planning/unified/dev.env
python3 planning/unified/deps/unified-planning/up_test_cases/report.py aries
tests: # Meta-job that only requires all test-jobs to pass
needs: [ lints, unit-tests, integration-tests, unified-planning-api, unified-planning-integration ]
runs-on: ubuntu-latest
steps:
- run: true
# ================ Building & Releasing binaries.
# Only active on the master branch and when the previous validation steps passed
build: # Build release binaries for all architecture and save them as artifacts
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
target: [ amd64, arm64 ]
exclude:
- os: ubuntu-latest
target: arm64 # linux-arm64 build has linker issues, done in a distinct job
fail-fast: false
name: Build - ${{ matrix.os }} - ${{ matrix.target }}
runs-on: ${{ matrix.os }}
if: (github.ref == 'refs/heads/master') || startsWith(github.ref, 'refs/tags/v')
defaults:
run:
shell: bash
steps:
- name: Checkout repo
uses: actions/checkout@master
with:
fetch-depth: 0
- uses: dtolnay/rust-toolchain@stable
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: "3.8"
- name: Set Environment Variables
run: |
if [ "${{ matrix.os }}" == "ubuntu-latest" ] && [ "${{ matrix.target }}" == "amd64" ]; then
echo "TARGET=x86_64-unknown-linux-musl" >> $GITHUB_ENV
echo "BINARY=up-aries_linux_amd64" >> $GITHUB_ENV
elif [ "${{ matrix.os }}" == "macos-latest" ] && [ "${{ matrix.target }}" == "amd64" ]; then
echo "TARGET=x86_64-apple-darwin" >> $GITHUB_ENV
echo "BINARY=up-aries_macos_amd64" >> $GITHUB_ENV
elif [ "${{ matrix.os }}" == "windows-latest" ] && [ "${{ matrix.target }}" == "amd64" ]; then
echo "TARGET=x86_64-pc-windows-msvc" >> $GITHUB_ENV
echo "BINARY=up-aries_windows_amd64.exe" >> $GITHUB_ENV
elif [ "${{ matrix.os }}" == "macos-latest" ] && [ "${{ matrix.target }}" == "arm64" ]; then
echo "TARGET=aarch64-apple-darwin" >> $GITHUB_ENV
echo "BINARY=up-aries_macos_arm64" >> $GITHUB_ENV
elif [ "${{ matrix.os }}" == "windows-latest" ] && [ "${{ matrix.target }}" == "arm64" ]; then
echo "TARGET=aarch64-pc-windows-msvc" >> $GITHUB_ENV
echo "BINARY=up-aries_windows_arm64.exe" >> $GITHUB_ENV
fi
- name: Install toolchain
run: rustup target add ${{ env.TARGET }}
- name: Build release binary
run: |
cargo build --release --target ${{ env.TARGET }} --bin up-server
mkdir -p bins/
cp target/${{ env.TARGET }}/release/up-server bins/${{ env.BINARY }}
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: ${{ env.BINARY }}
path: bins/${{ env.BINARY }}
retention-days: 1
# Deactivated as induces very long CI times
# # Build linux-aarch64 binaries in a dedicated container.
# build-linux-arm64:
# runs-on: ubuntu-latest
# name: Build - ubuntu-latest - arm64
# if: github.ref == 'refs/heads/master'
# needs: [lints, unit-tests, integration-tests, unified-planning-api]
# steps:
# - uses: actions/checkout@v3
# with:
# fetch-depth: 0
# - uses: uraimo/run-on-arch-action@v2
# name: Build on ubuntu-latest targetting ARM64
# id: build
# with:
# arch: aarch64
# distro: ubuntu20.04
#
# githubToken: ${{ secrets.GITHUB_TOKEN }}
#
# dockerRunArgs: |
# --privileged --volume "${PWD}:/workdir" --workdir /workdir
#
# shell: /bin/bash
# setup: mkdir -p bins/
# install: |
# apt-get update
# apt-get -y upgrade
# apt-get install -y libssl-dev libudev-dev pkg-config curl git
# apt-get install -y build-essential gcc-aarch64-linux-gnu python3.8
# curl https://sh.rustup.rs -sSf | sh -s -- -y
# echo $HOME/.cargo/bin >> ~/.bashrc
# source $HOME/.cargo/env
# rustup target add aarch64-unknown-linux-gnu
# run: |
# source $HOME/.cargo/env
# cargo build --release --target aarch64-unknown-linux-gnu --bin up-server
# cp target/aarch64-unknown-linux-gnu/release/up-server bins/up-aries_linux_arm64
# python3.8 ./ci/grpc.py --executable bins/up-aries_linux_arm64
#
# - name: Upload artifact
# uses: actions/upload-artifact@v2
# with:
# name: up-aries_linux_arm64
# path: bins/up-aries_linux_arm64
# retention-days: 1
package-python:
name: Python Package (up_aries)
needs: [ build ]
runs-on: ubuntu-latest
if: (github.ref == 'refs/heads/master') || startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v3
- name: Retrieve git tags # need full git history to determine version number when packaging
run: git fetch --prune --unshallow
- name: Available tags
run: |
git tag
git describe --tags --match v[0-9]*
- uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install build tools
run: pip install build
- uses: actions/download-artifact@v3
with:
path: planning/unified/plugin/artifacts
- name: Unpack artifacts
run: |
cd planning/unified/plugin/
ls -lR
mkdir -p up_aries/bin
cp artifacts/*/* up_aries/bin/
chmod +x up_aries/bin/*
ls -lR
python -m build --sdist
cp dist/up_aries-*.tar.gz up_aries.tar.gz
- uses: actions/upload-artifact@v3
with:
name: up_aries.tar.gz
path: planning/unified/plugin/up_aries.tar.gz
retention-days: 1
pre-release: # If on master branch, Upload all artifacts as a pre-release "latest"
name: Pre Release
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
needs: [ tests, build, package-python ]
steps:
- name: Download artifact
uses: actions/download-artifact@v2
- name: Display artifacts
run: ls -R
- uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: true
title: "Development Build"
files: |
up-aries_linux_amd64
up-aries_macos_amd64
up-aries_macos_arm64
up-aries_windows_amd64.exe
up-aries_windows_arm64.exe
up_aries.tar.gz
release: # If on a "v*" tag, cut a new non-draft release
name: Release
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
needs: [ tests, build, package-python ]
steps:
- name: Download artifact
uses: actions/download-artifact@v2
- name: Download TAR artifact for python package
uses: actions/download-artifact@v2
with:
name: up_aries.tar.gz
path: dist/
- name: Rename python package with version
run: mv dist/up_aries.tar.gz dist/up_aries-${{github.ref_name}}.tar.gz
- name: Display artifacts
run: ls -R
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1.6
with:
password: ${{ secrets.PYPI_TOKEN }}
packages_dir: dist
- uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
title: "${{ github.ref_name }}"
files: |
up-aries_linux_amd64
up-aries_macos_amd64
up-aries_macos_arm64
up-aries_windows_amd64.exe
up-aries_windows_arm64.exe
up_aries.tar.gz