Skip to content

Commit

Permalink
Merge pull request #21 from tenstorrent/vmilosevic/fix-actions
Browse files Browse the repository at this point in the history
Add build dependencies to github actions
  • Loading branch information
vmilosevic authored Apr 11, 2024
2 parents 6076038 + e8de218 commit df98c1f
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 6 deletions.
31 changes: 31 additions & 0 deletions .github/actions/install-deps/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: "Install dependencies"
description: "Installs dependencies on GitHub Actions runners"

inputs:
os:
description: 'Runner OS'
required: true

runs:
using: "composite"
steps:
- name: Verify ubuntu only
shell: bash
run: |
if ! echo ${{ inputs.os }} | grep -q "ubuntu"; then
echo "${{ inputs.os }} does not seem to be ubuntu"
fi
- name: Assert requested os exists in dependencies
shell: bash
run: |
if ! jq -e ".\"${{ inputs.os }}\" != null" $GITHUB_ACTION_PATH/dependencies.json; then
echo "${{ inputs.os }} does not exist as a supported os in $GITHUB_ACTION_PATH/dependencies.json"
fi
- name: Retrieve and install pkg deps based on OS
id: retrieve-pkg-deps
shell: bash
run: |
DEPENDENCIES=$(jq -r --arg os "${{ inputs.os }}" '.[$os] | .[]' $GITHUB_ACTION_PATH/dependencies.json)
echo $DEPENDENCIES
sudo apt update
sudo apt install $DEPENDENCIES
12 changes: 12 additions & 0 deletions .github/actions/install-deps/dependencies.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"ubuntu-22.04": [
"software-properties-common",
"build-essential",
"python3.10-venv",
"libyaml-cpp-dev",
"libboost-all-dev",
"libsndfile1",
"libhwloc-dev",
"libzmq3-dev"
]
}
10 changes: 8 additions & 2 deletions .github/workflows/build-artifacts.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
name: "Build artifacts"
name: Build artifacts

on:
workflow_dispatch:
workflow_call:

env:
PYTHON_VERSION: "python3.10"

jobs:
build-artifacts:
strategy:
matrix:
arch: ["grayskull"]
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install-deps
with:
os: ubuntu-22.04
- name: Update submodule
run: git submodule update --init --recursive
- name: Build for ${{ matrix.arch }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/post-commit-workflow.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Post commit workflow"
name: Post commit workflow

on:
workflow_dispatch:
Expand All @@ -8,6 +8,6 @@ on:
- main

jobs:
build-artifact:
uses: ./.github/workflows/build-artifact.yaml
build-artifacts:
uses: ./.github/workflows/build-artifacts.yml
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/pull-request-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ on:

jobs:
build-artifacts:
uses: ./.github/workflows/build-artifacts.yaml
uses: ./.github/workflows/build-artifacts.yml
secrets: inherit

0 comments on commit df98c1f

Please sign in to comment.