Skip to content

Commit 2abe812

Browse files
committed
Add GitHub actions workflow to run CI tests.
Add a workflow which replicates the Travis CI tests, with the following improvements: * Tests on both Linux and macOS, as opposed to just Linux. * Stores the bazel cache so that incremental test runs are faster. * Runs the CI tests on a weekly schedule, rather than only on push. This will be useful for catching issues that arise as dependencies update. github.com//issues/113 github.com//issues/114
1 parent 378ad9c commit 2abe812

File tree

2 files changed

+73
-2
lines changed

2 files changed

+73
-2
lines changed

.bazelrc

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,13 @@ build:ubsan --copt -fno-omit-frame-pointer
6565
build:ubsan --linkopt -fsanitize=undefined
6666
build:ubsan --linkopt -lubsan
6767

68-
# Control progress output when invoked by Travis
69-
build:travis --noshow_progress --noshow_loading_progress --show_task_finish --action_env=PATH
68+
# --config ci: Continuous Integration tool
69+
query:ci --noshow_progress
70+
query:ci --noshow_loading_progress
71+
build:ci --noshow_progress
72+
build:ci --noshow_loading_progress
73+
build:ci --show_task_finish
74+
build:ci --action_env=PATH
75+
build:ci --keep_going
76+
build:ci --verbose_failures
77+
build:ci --test_output=errors

.github/workflows/ci.yaml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
schedule:
7+
- cron: '0 0 * * 0' # weekly
8+
9+
jobs:
10+
test:
11+
runs-on: ${{ matrix.os }}
12+
13+
strategy:
14+
matrix:
15+
os: [ubuntu-latest, macos-latest]
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
20+
- name: "Linux: Mount bazel cache"
21+
uses: actions/cache@v2
22+
with:
23+
path: "/home/runner/.cache/bazel"
24+
key: ${{ matrix.os }}-bazel
25+
if: matrix.os == 'ubuntu-latest'
26+
27+
- name: "Linux: Install system dependencies"
28+
run: |
29+
curl -L "https://github.com/bazelbuild/bazelisk/releases/download/v1.6.1/bazelisk-linux-amd64" > bazel.tmp
30+
sudo mv bazel.tmp /usr/local/bin/bazel
31+
chmod +x /usr/local/bin/bazel
32+
if: matrix.os == 'ubuntu-latest'
33+
34+
- name: "macOS: Mount bazel cache"
35+
uses: actions/cache@v2
36+
with:
37+
path: "/private/var/tmp/_bazel_runner"
38+
key: ${{ matrix.os }}-bazel
39+
if: matrix.os == 'macos-latest'
40+
41+
- name: "macOS: Install system dependencies"
42+
run: |
43+
brew install freetype pkg-config bazelisk mysql-client coreutils findutils gnu-sed zlib
44+
echo "::add-path::/usr/local/opt/mysql-client/bin"
45+
if: matrix.os == 'macos-latest'
46+
47+
- name: Install python dependencies
48+
run: |
49+
python3 -m pip install --upgrade pip
50+
grep numpy requirements.txt | xargs python3 -m pip install
51+
python3 -m pip install setuptools
52+
echo "::add-path::/home/runner/.local/bin"
53+
54+
- name: whoami
55+
run: ./tools/whoami.sh
56+
57+
- name: Test
58+
run: bazel query --config=ci 'tests(//...) except attr("tags", "notravis", //...)' | xargs bazel test --config=ci
59+
60+
- name: Install
61+
run: |
62+
mkdir "${GITHUB_WORKSPACE}/install"
63+
bazel run --config=ci //:install "${GITHUB_WORKSPACE}/install"

0 commit comments

Comments
 (0)