-
Notifications
You must be signed in to change notification settings - Fork 1.4k
52 lines (45 loc) · 1.97 KB
/
precommit.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
# A workflow to run Bazel builds and tests.
name: precommit
on:
pull_request:
push:
branches:
- 'master'
- 'beta'
- 'gamma'
- 'macos'
jobs:
build-and-test:
name: Build and test ${{matrix.cfg.name}} ${{matrix.os.name}}
runs-on: ${{matrix.os.id}}
strategy:
matrix:
os:
- { name: 'Linux', id: 'ubuntu-22.04' }
cfg:
- { name: 'GCC', cc: gcc-12, cxx: g++-12, config: --copt=-Wno-maybe-uninitialized }
- { name: 'LLVM+libstdc++', cc: clang, cxx: clang++, config: --copt=-Wno-uninitialized }
- { name: 'LLVM+libc++', cc: clang, cxx: clang++, config: --config=libc++ --copt=-Wno-uninitialized }
env:
CC: ${{matrix.cfg.cc}}
CXX: ${{matrix.cfg.cxx}}
steps:
- uses: actions/checkout@v2
- name: install infrastructure
run: |
sudo apt-get update
sudo apt-get install gettext python3-dev libsdl2-dev libosmesa6-dev python3-numpy-dev python3-pil
sudo find /usr -type f -name Python.h -o -name arrayobject.h -o -name functional -o -name -filesystem
sudo ln -s /usr/lib/llvm-10/include/c++/v1 /usr/include/c++/v1
- name: build
run: |
bazel --bazelrc=.precommit.bazelrc build ${{matrix.cfg.config}} --copt=-Wno-sign-compare //... //:python_game_py3
- name: run-tests
timeout-minutes: 45
run: |
bazel --bazelrc=.precommit.bazelrc test ${{matrix.cfg.config}} --copt=-Wno-sign-compare //...
bazel --bazelrc=.precommit.bazelrc test ${{matrix.cfg.config}} --copt=-Wno-sign-compare //python/tests:python_module_test --test_tag_filters=""
bazel --bazelrc=.precommit.bazelrc test ${{matrix.cfg.config}} --copt=-Wno-sign-compare //python/tests:dmenv_module_test --test_tag_filters=""
- name: run-agent
run: |
bazel --bazelrc=.precommit.bazelrc run ${{matrix.cfg.config}} --copt=-Wno-sign-compare --define headless=osmesa //:python_random_agent