-
Notifications
You must be signed in to change notification settings - Fork 4
38 lines (30 loc) · 1.09 KB
/
build_and_test.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
38
name: CUDAQLibs Build and Test
on:
pull_request:
branches:
- main
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up context for buildx
run: |
docker context create builder_context
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch
- name: Set up buildx runner
uses: docker/setup-buildx-action@v3
with:
endpoint: builder_context
- name: Build CUDAQLib
id: cudaq_build
run: |
DOCKER_BUILDKIT=1 docker build --network host --build-arg="branch=${{ steps.extract_branch.outputs.branch }}" \
--build-arg="repo=${{github.event.pull_request.head.repo.full_name}}" -t cudaqlib-dev:local -f docker/ci/Dockerfile .
- name: Run tests
run: docker run --rm cudaqlib-dev:local ctest --output-on-failure --test-dir cudaqlib/build
run: docker run --rm cudaqlib-dev:local python3 -m pytest cudaqlib/python/tests -v