-
Notifications
You must be signed in to change notification settings - Fork 16
91 lines (88 loc) · 3.01 KB
/
pants.yaml
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
# inspired by https://github.com/pantsbuild/example-python/blob/main/.github/workflows/pants.yaml
# also see https://stackoverflow.com/a/66632107/3142796
name: Pants
on:
pull_request:
branches:
- master
jobs:
org-check:
name: Check GitHub Organization
if: ${{ github.repository_owner == 'robofit' }}
runs-on: ubuntu-20.04
steps:
- name: Noop
run: "true"
build:
env:
PANTS_CONFIG_FILES: pants.ci.toml
runs-on: ubuntu-20.04
needs: org-check
strategy:
matrix:
python-version: ['3.10']
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@v10
with:
root-reserve-mb: 35000
swap-size-mb: 1024
remove-dotnet: 'true'
remove-android: 'true'
remove-haskell: 'true'
remove-docker-images: 'true'
- uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: true
- name: Checkout LFS objects
run: git lfs checkout
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: pantsbuild/actions/init-pants@v2
with:
pants-python-version: ${{ matrix.python-version }}
gha-cache-key: cache0-py${{ matrix.python-version }}
named-caches-hash: ${{ hashFiles('/3rdparty/constraints.txt') }}
cache-lmdb-store: 'true' # defaults to 'false'
base-branch: master
- name: Check BUILD files
run: |
./pants --changed-since=HEAD update-build-files --check
- name: install system dependencies
run: |
sudo ./build-support/install_kinect_prerequisites.sh
sudo apt install jq
- name: Lint
run: |
./pants --changed-since=origin/master lint
- name: Typecheck
run: |
./pants check --changed-since=origin/master --changed-dependees=transitive
- name: Test
run: |
./pants --changed-since=origin/master --changed-dependees=transitive test
- name: Build Docker images
run: | # filter out non-essential docker images (there was a problem with full storage on github)
./pants filter --target-type=docker_image --changed-since=origin/master --changed-dependees=transitive | grep -v arcor2_3d_mouse | grep -v arcor2_kinect_azure | grep -v arcor2_fanuc arcor2_fanuc_upload_object_types | xargs ./pants package
- name: Build Python packages
run: |
./pants filter --target-type=python_distribution :: | xargs ./pants package
# check for cyclic dependencies or other problems
python -m venv ./tstvenv
source ./tstvenv/bin/activate
pip install dist/*.tar.gz
pip install pipdeptree
pipdeptree -w fail
- name: Upload pants log
uses: actions/upload-artifact@v4
with:
name: pants-log
path: .pants.d/pants.log
if: always() # We want the log even on failures.
- name: Prune pants cache
run: |
./build-support/nuke-cache.sh
if: always()