-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#55] Fix das-node pipeline and create pipeline for python and c++ te…
…sts (#56) * das-node-55: Fix publish steps * das-node-55: Add python and c++ tests * das-node-55: build bazel in run-tests pipeline * das-node-55: Update github registry * das-node-55: Fix github repository image * das-node-55: Update pipeline * das-node-55: Get cache wheeler * das-node-55: Fix wheel dist * das-node-55: use bind volume for bazel cache * das-node-55: cache * das-node-55: Update run-tests pipeline * das-node-55: Give permissions * das-node-55: Set permissions for cache * das-node-55: Update volume owner
- Loading branch information
1 parent
ada3421
commit 896268b
Showing
7 changed files
with
185 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,174 @@ | ||
--- | ||
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: Set permissions for cached directories | ||
run: | | ||
sudo chmod -R 777 ./bazel_assets | ||
sudo chmod -R 777 ./docker/volumes/ | ||
- name: Cache build and bazel_assets directories | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
./bazel_assets | ||
./docker/volumes/bazel_cache | ||
key: ${{ runner.os }}-cpp-build-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-cpp-build-${{ github.sha }} | ||
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: Cache build and bazel_assets directories | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
./bazel_assets | ||
./docker/volumes/bazel_cache | ||
key: ${{ runner.os }}-cpp-build-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-cpp-build-${{ github.sha }} | ||
- name: Set permissions for cached directories | ||
run: | | ||
sudo chown root:root -R ./bazel_assets | ||
sudo chown root:root -R ./docker/volumes/ | ||
- 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: Cache build and bazel_assets directories | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
./bazel_assets | ||
./docker/volumes/bazel_cache | ||
key: ${{ runner.os }}-cpp-build-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-cpp-build-${{ github.sha }} | ||
- name: Set permissions for cached directories | ||
run: | | ||
sudo chmod -R 777 ./bazel_assets | ||
sudo chmod -R 777 ./docker/volumes/ | ||
- name: Build docker image | ||
run: make wheeler-image | ||
|
||
- 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: | | ||
./bazel_assets | ||
./docker/volumes/bazel_cache | ||
key: ${{ runner.os }}-cpp-build-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-cpp-build-${{ github.sha }} | ||
- name: Set permissions for cached directories | ||
run: | | ||
sudo chmod -R 777 ./bazel_assets | ||
sudo chmod -R 777 ./docker/volumes/ | ||
- 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters