-
Notifications
You must be signed in to change notification settings - Fork 5
37 lines (29 loc) · 1.13 KB
/
unittests.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
name: unittests
on:
pull_request: # This triggers the workflow for pull requests
branches:
- main # Run tests for pull requests targeting the "main" branch
push:
branches:
- main # Optional: Run tests for direct pushes to "main"
workflow_dispatch: # allow manual triggering
concurrency:
group: clang-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
bazel-tests:
runs-on: ubuntu-latest
steps:
# Checkout the code from the repository
- name: Checkout Code
uses: actions/checkout@v3
# Set up Docker to build and run the container
- name: Set up Docker
uses: docker/setup-buildx-action@v2
# Build the Docker image from the Dockerfile in your repo
- name: Build Docker Image
run: docker build -t presubmit-image -f .devcontainer/Dockerfile .
- name: Run Tests
run: docker run --rm -v "$(pwd):/workspace" --user "$(id -u):$(id -g)" presubmit-image bazel test --jobs=4 testing/...
- name: Run vmsdk Tests
run: docker run --rm -v "$(pwd):/workspace" --user "$(id -u):$(id -g)" presubmit-image bazel test --jobs=4 vmsdk/testing/...