-
Notifications
You must be signed in to change notification settings - Fork 130
97 lines (82 loc) · 3.12 KB
/
build.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
92
93
94
95
96
97
---
# This workflow is used to build the binary wheels that can be uploaded to pypi
# for releases. It produces an artifact containing a macOS and manylinux binary
# wheel from the requested branch. It also runs the full test suite against
# these wheels.
name: Build Binaries
on:
workflow_dispatch:
pull_request:
branches: [stable]
push:
branches: [stable]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
steps:
- uses: actions/checkout@v3
- name: Evaluate artifact name
run: |
echo "ARTIFACT=compiler_gym-$(cat VERSION)" >> $GITHUB_ENV
echo "Artifact name is $ARTIFACT"
- uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install build dependencies
uses: ./.github/actions/install-build-dependencies
- name: Build Python wheel
run: |
if [ "$(uname)" = "Darwin" ]; then
make bdist_wheel
else
make bdist_wheel-linux
fi
env:
BAZEL_OPTS: --batch
BAZEL_FETCH_OPTS: --config=ci
BAZEL_BUILD_OPTS: --config=ci -c opt
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT }}
path: dist/*.whl
if-no-files-found: error
retention-days: 14
examples-test:
needs: build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest]
python: [3.7, 3.8, 3.9, '3.10']
steps:
- uses: actions/checkout@v3
- name: Evaluate artifact name
run: |
echo "ARTIFACT=compiler_gym-$(cat VERSION)" >> $GITHUB_ENV
echo "Artifact name is $ARTIFACT"
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: ${{ env.ARTIFACT }}
- name: Install wheel
run: |
if [ "$(uname)" = "Darwin" ]; then
python -m pip install compiler_gym-*-macosx*.whl
else
python -m pip install compiler_gym-*-manylinux*.whl
fi
- name: Install test dependencies
run: python -m pip install -r examples/requirements.txt -r tests/requirements.txt
- name: Install runtime dependencies
uses: ./.github/actions/install-runtime-dependencies
- name: Run the examples tests
run: make -C examples test PYTEST_ARGS="--ignore loop_optimizations_service --ignore example_unrolling_service"