Skip to content

[#55] Fix das-node pipeline and create pipeline for python and c++ tests #22

[#55] Fix das-node pipeline and create pipeline for python and c++ tests

[#55] Fix das-node pipeline and create pipeline for python and c++ tests #22

Workflow file for this run

---
name: Run DAS Node tests
on:
pull_request:
types:
- opened
- reopened
- edited
- synchronize
workflow_dispatch:
jobs:
build-bazel:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository code
uses: actions/checkout@v4
- name: Build docker image
run: make cpp-image
- name: Login to Github Registry
if: success()
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push image to repository
run: |-
docker tag das-node-builder:latest ghcr.io/${{ github.repository_owner }}/das-node-builder:${{ github.sha }}
docker push ghcr.io/${{ github.repository_owner }}/das-node-builder:${{ github.sha }}
- name: Build bazel
run: make cpp-build
- name: Cache build and bazel_assets directories
uses: actions/cache@v3
with:
path: |
build
bazel_assets
docker/volumes/bazel_cache
key: ${{ runner.os }}-cpp-build-${{ hashFiles('**/CMakeLists.txt') }}-${{ hashFiles('**/*.cpp') }}
restore-keys: |
${{ runner.os }}-cpp-build-${{ hashFiles('**/CMakeLists.txt') }}
${{ runner.os }}-cpp-build
cpp-tests:
runs-on: ubuntu-22.04
needs: build-bazel
steps:
- name: Checkout repository code
uses: actions/checkout@v4
- name: Login to Github Registry
if: success()
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Pull docker image from registry
run: |-
docker pull ghcr.io/${{ github.repository_owner }}/das-node-builder:${{ github.sha }}
docker tag ghcr.io/${{ github.repository_owner }}/das-node-builder:${{ github.sha }} das-node-builder:latest
- name: Run cpp tests
run: make cpp-test
build-wheeler:
runs-on: ubuntu-22.04
needs: build-bazel
steps:
- name: Checkout repository code
uses: actions/checkout@v4
- name: Build docker image
run: make wheeler-image
- name: Cache build and bazel_assets directories
uses: actions/cache@v3
with:
path: |
build
bazel_assets
key: ${{ runner.os }}-cpp-build-${{ hashFiles('**/CMakeLists.txt') }}-${{ hashFiles('**/*.cpp') }}
restore-keys: |
${{ runner.os }}-cpp-build-${{ hashFiles('**/CMakeLists.txt') }}
${{ runner.os }}-cpp-build
- name: Build wheeler
run: make wheeler-build
- name: Upload wheeler artifacts
uses: actions/upload-artifact@v4
with:
name: wheelers
path: dist/*
wheel-test:
runs-on: ubuntu-22.04
needs:
- build-bazel
- build-wheeler
steps:
- name: Checkout repository code
uses: actions/checkout@v4
- name: Login to Github Registry
if: success()
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Pull docker image from registry
run: |-
docker pull ghcr.io/${{ github.repository_owner }}/das-node-builder:${{ github.sha }}
docker tag ghcr.io/${{ github.repository_owner }}/das-node-builder:${{ github.sha }} das-node-builder:latest
- name: Cache build and bazel_assets directories
uses: actions/cache@v3
with:
path: |
build
bazel_assets
key: ${{ runner.os }}-cpp-build-${{ hashFiles('**/CMakeLists.txt') }}-${{ hashFiles('**/*.cpp') }}
restore-keys: |
${{ runner.os }}-cpp-build-${{ hashFiles('**/CMakeLists.txt') }}
${{ runner.os }}-cpp-build
- name: Download wheeler artifacts
uses: actions/download-artifact@v4
with:
name: wheelers
path: dist
- name: Install Python dependencies
run: pip install dist/*.whl
- name: Run python tests
run: make wheeler-test