2020-07-09 00:56:46 +03:00
|
|
|
name: Bazel CI
|
2020-07-09 00:52:06 +03:00
|
|
|
|
|
|
|
on:
|
|
|
|
# Trigger the workflow on push or pull request,
|
|
|
|
# but only for the master branch
|
2020-09-16 15:22:25 +03:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
pull_request: {}
|
2020-07-09 00:52:06 +03:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2020-07-09 00:54:56 +03:00
|
|
|
name: Bazel
|
2020-07-09 00:52:06 +03:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master'
|
|
|
|
|
2020-07-10 17:28:22 +03:00
|
|
|
- uses: actions/cache@v2
|
2020-07-10 17:49:06 +03:00
|
|
|
id: caching-stage
|
2020-07-09 00:54:56 +03:00
|
|
|
name: Cache Bazel artifacts
|
2020-07-09 00:52:06 +03:00
|
|
|
with:
|
2020-07-10 17:28:22 +03:00
|
|
|
path: |
|
|
|
|
.bazel-cache
|
2020-07-10 20:10:19 +03:00
|
|
|
bin
|
2020-07-10 19:59:56 +03:00
|
|
|
key: ${{ runner.os }}-bazel-${{ github.run_id }}
|
2020-07-09 00:52:06 +03:00
|
|
|
restore-keys: |
|
2020-07-09 00:54:56 +03:00
|
|
|
${{ runner.os }}-bazel-
|
2020-07-09 00:52:06 +03:00
|
|
|
|
2020-07-10 21:22:35 +03:00
|
|
|
- name: Download/cache bazel version
|
|
|
|
if: steps.caching-stage.outputs.cache-hit != 'true'
|
|
|
|
run: |
|
2020-07-10 21:28:08 +03:00
|
|
|
if [ ! -f bin/bazel ]; then
|
|
|
|
curl -LO "https://github.com/bazelbuild/bazel/releases/download/3.1.0/bazel-3.1.0-linux-x86_64"
|
|
|
|
mv bazel-3.1.0-linux-x86_64 "bin/bazel"
|
|
|
|
chmod +x "bin/bazel"
|
|
|
|
fi
|
2020-07-10 21:22:35 +03:00
|
|
|
|
2020-07-09 00:52:06 +03:00
|
|
|
- name: Build & test
|
|
|
|
run: |
|
2020-09-02 21:21:33 +03:00
|
|
|
bin/bazel clean
|
2020-09-16 15:48:23 +03:00
|
|
|
bin/bazel test --config=ci --test_tag_filters=language-test //...
|
|
|
|
bin/bazel test --config=ci //semantic-source //semantic:spec
|