From 16f9e6f13e90d5067a522f6861488b5eae2c0578 Mon Sep 17 00:00:00 2001 From: Peter Oschwald Date: Fri, 28 Jul 2023 10:16:47 -0500 Subject: [PATCH] Try building up from base docker image. --- .cicd/platforms.json | 6 ++++ .cicd/platforms/ubuntu20.Dockerfile | 10 ++++++ .github/workflows/build-node.sh | 9 +++--- .github/workflows/node.yml | 50 ++++++++++++++++++++++++++++- 4 files changed, 69 insertions(+), 6 deletions(-) create mode 100644 .cicd/platforms.json create mode 100644 .cicd/platforms/ubuntu20.Dockerfile diff --git a/.cicd/platforms.json b/.cicd/platforms.json new file mode 100644 index 0000000..8268f2f --- /dev/null +++ b/.cicd/platforms.json @@ -0,0 +1,6 @@ +{ + "ubuntu20": { + "dockerfile": ".cicd/platforms/ubuntu20.Dockerfile" + } + } + \ No newline at end of file diff --git a/.cicd/platforms/ubuntu20.Dockerfile b/.cicd/platforms/ubuntu20.Dockerfile new file mode 100644 index 0000000..7bbacd0 --- /dev/null +++ b/.cicd/platforms/ubuntu20.Dockerfile @@ -0,0 +1,10 @@ +FROM ubuntu:focal +ENV TZ="America/New_York" +ENV DEBIAN_FRONTEND=noninteractive +RUN apt-get update && apt-get upgrade -y && \ + apt-get install -y build-essential \ + cmake \ + gcc-10 \ + g++-10 \ + git +RUN pip install -v "conan==1.60.2" diff --git a/.github/workflows/build-node.sh b/.github/workflows/build-node.sh index 9d5af56..a9d674f 100755 --- a/.github/workflows/build-node.sh +++ b/.github/workflows/build-node.sh @@ -9,11 +9,10 @@ function ee() } # install dependencies for self-hosted runners -ee export DEBIAN_FRONTEND='noninteractive' -ee sudo apt-get update -q -ee sudo apt-get upgrade -y -ee sudo apt-get install -yqq cmake gcc-10 g++-10 -ee sudo pip install -v "conan==1.60.2" +# ee export DEBIAN_FRONTEND='noninteractive' +# ee sudo apt-get update -q +# ee sudo apt-get install -yqq cmake gcc-10 g++-10 +# ee sudo pip install -v "conan==1.60.2" # debug code echo "CC='${CC}'" diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 52ac1cb..3131b38 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -31,9 +31,57 @@ jobs: - name: Attach Documentation run: cat .github/workflows/node.md >> $GITHUB_STEP_SUMMARY + d: + name: Discover Platforms + runs-on: ubuntu-latest + outputs: + missing-platforms: ${{steps.discover.outputs.missing-platforms}} + p: ${{steps.discover.outputs.platforms}} + steps: + - name: Discover Platforms + id: discover + uses: AntelopeIO/discover-platforms-action@v1 + with: + platform-file: .cicd/platforms.json + password: ${{secrets.GITHUB_TOKEN}} + package-name: builders + + build-platforms: + name: Build Platforms + needs: d + if: needs.d.outputs.missing-platforms != '[]' + strategy: + fail-fast: false + matrix: + platform: ${{fromJSON(needs.d.outputs.missing-platforms)}} + runs-on: ["self-hosted", "enf-x86-beefy"] + permissions: + packages: write + contents: read + steps: + - name: Login to Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{github.repository_owner}} + password: ${{secrets.GITHUB_TOKEN}} + - name: Build and push + uses: docker/build-push-action@v3 + with: + push: true + tags: ${{fromJSON(needs.d.outputs.p)[matrix.platform].image}} + file: ${{fromJSON(needs.d.outputs.p)[matrix.platform].dockerfile}} + build: name: EOS EVM Node Build - runs-on: ubuntu-20.04 + needs: [d, build-platforms] + if: always() && needs.d.result == 'success' && (needs.build-platforms.result == 'success' || needs.build-platforms.result == 'skipped') + strategy: + fail-fast: false + matrix: + platform: [ ubuntu20 ] + runs-on: ubuntu-latest + container: ${{fromJSON(needs.d.outputs.p)[matrix.platform].image}} steps: - name: Authenticate