Skip to content

test

test #73

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: bazel
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [master]
paths:
- "bazel/**"
pull_request:
paths:
- "bazel/**"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
LAUNCHABLE_TOKEN: ${{ secrets.LAUNCHABLE_TOKEN_BAZEL }}
LAUNCHABLE_DEBUG: 1
LAUNCHABLE_REPORT_ERROR: 1
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
tests:
# The type of runner that the job will run on
runs-on: ubuntu-latest
defaults:
run:
working-directory: bazel/java
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- uses: actions/setup-go@v2
- name: Install Bazelisk
run: |
go get github.com/bazelbuild/bazelisk
export PATH=$PATH:$(go env GOPATH)/bin
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install wheel setuptools_scm
pip install launchable
- run: "launchable verify"
- name: Record commits and build
run: 'launchable record build --name "$GITHUB_RUN_ID" --source ../..' # care for working-directory path
- name: Start session
run: 'launchable record session --build "$GITHUB_RUN_ID" > test_session.txt'
- name: Print session
run: cat test_session.txt
- name: Print test cases
run: bazelisk query 'tests(//...)'
- name: Output subset
run: bazelisk query 'tests(//...)' | launchable subset --target 30% --session "$(cat test_session.txt)" --rest rest.txt bazel > subset.txt
- name: Print subset
run: cat subset.txt
- name: Print rest
run: cat rest.txt
- name: Run subset
run: bazelisk test $(cat subset.txt)
- name: Run rest
run: bazelisk test $(cat rest.txt)
- name: Record test results
run: launchable record test --session "$(cat test_session.txt)" bazel .
if: always()