Skip to content

Commit

Permalink
github workflow changes
Browse files Browse the repository at this point in the history
  • Loading branch information
yairgott committed Jan 22, 2025
1 parent f479835 commit 6f6a8d3
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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/...

0 comments on commit 6f6a8d3

Please sign in to comment.