-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#0: Workflow to test compatibility with TTNN Project Template
- Loading branch information
1 parent
5c967ad
commit aa90c2a
Showing
1 changed file
with
88 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
name: Build TTNN C++ project | ||
|
||
on: | ||
workflow_call: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
|
||
build-docker-image: | ||
uses: ./.github/workflows/build-docker-artifact.yaml | ||
secrets: inherit | ||
with: | ||
os: ubuntu-22.04-amd64 | ||
|
||
ttnn-project: | ||
needs: build-docker-image | ||
runs-on: | ||
- ubuntu-22.04 | ||
env: | ||
ARCH_NAME: wormhole_b0 | ||
|
||
steps: | ||
# Metalium | ||
- name: Clone Metalium | ||
uses: tenstorrent-metal/metal-workflows/.github/actions/[email protected] | ||
- name: Generate docker tag | ||
id: generate-docker-tag | ||
uses: ./.github/actions/generate-docker-tag | ||
with: | ||
image: ubuntu-22.04-amd64 | ||
- name: Docker login | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: https://ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Pull docker image | ||
run: docker pull ${{ env.TT_METAL_DOCKER_IMAGE_TAG }} | ||
- name: Move Repo A to Subdirectory | ||
run: | | ||
mkdir metalium | ||
mv * metalium || true | ||
mv .git metalium/.git | ||
- name: Build Metalium | ||
uses: addnab/docker-run-action@v3 | ||
with: | ||
image: ${{ env.TT_METAL_DOCKER_IMAGE_TAG }} | ||
options: | | ||
--rm | ||
--tmpfs /tmp | ||
-u ${{ env.RUNNER_UID }}:${{ env.RUNNER_GID }} | ||
-v ${{ github.workspace }}/metalium:${{ github.workspace }} | ||
-v /etc/passwd:/etc/passwd:ro | ||
-v /etc/shadow:/etc/shadow:ro | ||
-v /etc/bashrc:/etc/bashrc:ro | ||
-e ARCH_NAME=${{ env.ARCH_NAME }} | ||
-w ${{ github.workspace }} | ||
run: | | ||
set -eu # basic shell hygiene | ||
./build_metal.sh --disable-unity-builds --build-type Release | ||
# TTNN project | ||
- name: Checkout cpp-ttnn-project-template | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: tenstorrent/cpp-ttnn-project-template | ||
path: project | ||
- name: Build TTNN Project | ||
uses: addnab/docker-run-action@v3 | ||
with: | ||
image: ${{ env.TT_METAL_DOCKER_IMAGE_TAG }} | ||
options: | | ||
--rm | ||
--tmpfs /tmp | ||
-u ${{ env.RUNNER_UID }}:${{ env.RUNNER_GID }} | ||
-v ${{ github.workspace }}/metalium:${{ github.workspace }}/metalium | ||
-v ${{ github.workspace }}/project:${{ github.workspace }}/project | ||
-v /etc/passwd:/etc/passwd:ro | ||
-v /etc/shadow:/etc/shadow:ro | ||
-v /etc/bashrc:/etc/bashrc:ro | ||
-e ARCH_NAME=${{ env.ARCH_NAME }} | ||
-e TT_METAL_HOME=${{ github.workspace }}/metalium | ||
-w ${{ github.workspace }}/project | ||
run: | | ||
set -eu # basic shell hygiene | ||
mkdir -p build && cd build | ||
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release .. | ||
ninja |