diff --git a/.github/actions/install-deps/action.yml b/.github/actions/install-deps/action.yml new file mode 100644 index 00000000..1f13767d --- /dev/null +++ b/.github/actions/install-deps/action.yml @@ -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 diff --git a/.github/actions/install-deps/dependencies.json b/.github/actions/install-deps/dependencies.json new file mode 100644 index 00000000..2faab167 --- /dev/null +++ b/.github/actions/install-deps/dependencies.json @@ -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" + ] +} diff --git a/.github/workflows/build-artifacts.yml b/.github/workflows/build-artifacts.yml index 90373f61..5e52e7e8 100644 --- a/.github/workflows/build-artifacts.yml +++ b/.github/workflows/build-artifacts.yml @@ -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 }} diff --git a/.github/workflows/post-commit-workflow.yml b/.github/workflows/post-commit-workflow.yml index 4387b275..ceb7d58d 100644 --- a/.github/workflows/post-commit-workflow.yml +++ b/.github/workflows/post-commit-workflow.yml @@ -1,4 +1,4 @@ -name: "Post commit workflow" +name: Post commit workflow on: workflow_dispatch: @@ -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 \ No newline at end of file diff --git a/.github/workflows/pull-request-workflow.yml b/.github/workflows/pull-request-workflow.yml index 27fb4e8b..c5fbe795 100644 --- a/.github/workflows/pull-request-workflow.yml +++ b/.github/workflows/pull-request-workflow.yml @@ -9,5 +9,5 @@ on: jobs: build-artifacts: - uses: ./.github/workflows/build-artifacts.yaml + uses: ./.github/workflows/build-artifacts.yml secrets: inherit \ No newline at end of file