From e2ab5d68adcf7844b6dd2bfd6fe85e92a64567dd Mon Sep 17 00:00:00 2001 From: Piotr Galar Date: Fri, 22 Mar 2024 12:57:03 +0000 Subject: [PATCH] ci: ci: create gh workflow that runs go build (#11760) * ci: create gh action that installs go from go.mod * ci: create gh action that installs ubuntu dependencies * ci: create gh workflow that runs go build * ci: test the build workflow * Revert "ci: test the build workflow" This reverts commit 8150510aae4d6d1fb1d719e2d69057a3c0695d32. --- .github/actions/install-go/action.yml | 16 ++++++++++ .../actions/install-ubuntu-deps/action.yml | 10 +++++++ .github/workflows/build.yml | 29 +++++++++++++++++++ 3 files changed, 55 insertions(+) create mode 100644 .github/actions/install-go/action.yml create mode 100644 .github/actions/install-ubuntu-deps/action.yml create mode 100644 .github/workflows/build.yml diff --git a/.github/actions/install-go/action.yml b/.github/actions/install-go/action.yml new file mode 100644 index 000000000..173559284 --- /dev/null +++ b/.github/actions/install-go/action.yml @@ -0,0 +1,16 @@ +name: Install Go +description: Install Go for Filecoin Lotus + +runs: + using: composite + steps: + - uses: actions/setup-go@v5 + with: + go-version: stable + cache: false + - id: go-mod + uses: ipdxco/unified-github-workflows/.github/actions/read-go-mod@main + - uses: actions/setup-go@v5 + with: + go-version: ${{ fromJSON(steps.go-mod.outputs.json).Go }}.x + cache: false diff --git a/.github/actions/install-ubuntu-deps/action.yml b/.github/actions/install-ubuntu-deps/action.yml new file mode 100644 index 000000000..395e8d47b --- /dev/null +++ b/.github/actions/install-ubuntu-deps/action.yml @@ -0,0 +1,10 @@ +name: Install Ubuntu Dependencies +description: Install Ubuntu dependencies for Filecoin Lotus + +runs: + using: composite + steps: + - run: | + sudo apt-get update -y + sudo apt-get install -y ocl-icd-opencl-dev libhwloc-dev pkg-config + shell: bash diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..cb56c05de --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,29 @@ +name: Build + +on: + pull_request: + push: + branches: + - master + - release/* + workflow_dispatch: + +defaults: + run: + shell: bash + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + submodules: 'recursive' + - uses: ./.github/actions/install-ubuntu-deps + - uses: ./.github/actions/install-go + - run: make deps lotus