Skip to content

Commit 1244d92

Browse files
authored
Fix cmake on self-runner (#460)
Fix cmake on self-runner (#460)
1 parent c82e0f9 commit 1244d92

File tree

4 files changed

+20
-99
lines changed

4 files changed

+20
-99
lines changed

.github/actions/build-cpp/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ LABEL author="Everton Haise Taques <[email protected]>"
44
LABEL maintainer="NS1 Labs"
55
LABEL version="1.0.0"
66

7-
ENV BUILD_DEPS "g++ cmake make git pkgconf jq python3-pip python3-setuptools ca-certificates libasan6 zip curl"
7+
ENV BUILD_DEPS "g++ cmake make git pkgconf jq python3-pip python3-setuptools ca-certificates libasan6 zip curl python"
88

99
COPY ./entrypoint.sh /entrypoint.sh
1010

.github/hosted-runner/amd64/user_data.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ apt-get update -y
55
apt-get install apt-transport-https qemu qemu-user-static ca-certificates gnupg2 curl tar software-properties-common build-essential zlib1g-dev \
66
libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev libreadline-dev libffi-dev libbz2-dev python3 python3-pip python3-dev python xvfb \
77
libfontconfig1 libfreetype6 xfonts-scalable fonts-liberation fonts-noto-cjk g++-10-arm-linux-gnueabihf g++-10-multilib-arm-linux-gnueabihf \
8-
gcc-10-arm-linux-gnueabihf gcc-10-arm-linux-gnueabihf-base gcc-10-multilib-arm-linux-gnueabihf python3-venv tcpreplay docker.io containerd -y
8+
gcc-10-arm-linux-gnueabihf gcc-10-arm-linux-gnueabihf-base gcc-10-multilib-arm-linux-gnueabihf python3-venv tcpreplay docker.io containerd cmake -y
99

1010
#set permission to use docker
1111
usermod -aG docker ubuntu

.github/hosted-runner/arm64/user_data.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
apt-get update -y
55
apt-get install apt-transport-https qemu qemu-user-static ca-certificates gnupg2 curl tar software-properties-common build-essential zlib1g-dev \
66
libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev libreadline-dev libffi-dev libbz2-dev python3 python3-pip python3-dev python2 xvfb \
7-
libfontconfig1 libfreetype6 xfonts-scalable fonts-liberation fonts-noto-cjk g++-10-arm-linux-gnueabihf \
7+
libfontconfig1 libfreetype6 xfonts-scalable fonts-liberation fonts-noto-cjk g++-10-arm-linux-gnueabihf cmake \
88
gcc-10-arm-linux-gnueabihf gcc-10-arm-linux-gnueabihf-base python3-venv tcpreplay docker.io containerd -y
99

1010
#set permission to use docker

.github/workflows/build-develop.yml

Lines changed: 17 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ jobs:
7575
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
7676

7777
runs-on: ubuntu-latest
78+
outputs:
79+
version_number: ${{ steps.build.outputs.version }}
7880
steps:
7981
- uses: actions/checkout@v2
8082

@@ -103,6 +105,12 @@ jobs:
103105
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
104106
run: PKG_CONFIG_PATH=${{github.workspace}}/local/lib/pkgconfig cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE
105107

108+
- name: Get VERSION
109+
id: build
110+
run: |
111+
echo "VERSION=`cat ${{github.workspace}}/build/VERSION`" >> $GITHUB_ENV
112+
echo "::set-output name=version::$(cat ${{github.workspace}}/build/VERSION)"
113+
106114
- name: Build
107115
working-directory: ${{github.workspace}}/build
108116
shell: bash
@@ -125,9 +133,6 @@ jobs:
125133
package-amd64:
126134
needs: [ unit-tests-linux ]
127135
runs-on: ubuntu-latest
128-
outputs:
129-
version_number: ${{ steps.build.outputs.version }}
130-
branch_name: ${{ steps.branch.outputs.name }}
131136
# if this is a push into one of our main branches (rather than just a pull request), we will also package
132137
if: github.event_name != 'pull_request'
133138
steps:
@@ -151,38 +156,6 @@ jobs:
151156
- name: Debug artifacts
152157
run: ls -lha .
153158

154-
- name: Get branch name
155-
id: branch
156-
shell: bash
157-
run: |
158-
echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV
159-
echo "::set-output name=name::$(echo ${GITHUB_REF#refs/heads/} | tr / -)"
160-
161-
- name: Debug branch name
162-
run: echo ${{ env.BRANCH_NAME }}
163-
164-
- name: Create Build Environment
165-
run: cmake -E make_directory ${{github.workspace}}/build
166-
167-
- name: Get Conan
168-
uses: turtlebrowser/[email protected]
169-
170-
- name: Configure CMake to generate VERSION
171-
shell: bash
172-
working-directory: ${{github.workspace}}/build
173-
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE
174-
175-
- name: Get VERSION
176-
id: build
177-
run: |
178-
echo "VERSION=`cat ${{github.workspace}}/build/VERSION`" >> $GITHUB_ENV
179-
echo "::set-output name=version::$(cat ${{github.workspace}}/build/VERSION)"
180-
181-
- name: Debug version
182-
run: |
183-
echo ${{ env.VERSION }}
184-
echo ${{ steps.build.outputs.version }}
185-
186159
- name: Generate ref tag (develop)
187160
run: |
188161
echo "REF_TAG=latest-develop" >> $GITHUB_ENV
@@ -233,7 +206,7 @@ jobs:
233206
file: ./docker/Dockerfile.crashhandler
234207
platforms: linux/amd64
235208
push: true
236-
tags: ${{ env.IMAGE_NAME }}:${{ env.VERSION }} , ${{ env.IMAGE_NAME }}:${{ env.REF_TAG }} , ${{ env.IMAGE_NAME2 }}:amd64
209+
tags: ${{ env.IMAGE_NAME }}:${{ needs.unit-tests-linux.outputs.version_number }} , ${{ env.IMAGE_NAME }}:${{ env.REF_TAG }} , ${{ env.IMAGE_NAME2 }}:amd64
237210

238211
build-app-image-x64:
239212
needs: [ package-amd64 ]
@@ -661,7 +634,7 @@ jobs:
661634
retention-days: 1
662635

663636
package-arm64:
664-
needs: [ spinup-arm64-runner ]
637+
needs: [ unit-tests-linux, spinup-arm64-runner ]
665638
runs-on: [self-hosted, linux, ARM64]
666639
if: github.event_name != 'pull_request'
667640
steps:
@@ -682,32 +655,9 @@ jobs:
682655
with:
683656
context: "."
684657
file: "./Dockerfile"
685-
686-
- name: Get branch name
687-
shell: bash
688-
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV
689-
690-
- name: Debug branch name
691-
run: echo ${{ env.BRANCH_NAME }}
692-
693-
- name: Create Build Environment
694-
run: cmake -E make_directory ${{github.workspace}}/build
695-
696-
- name: Get Conan
697-
uses: turtlebrowser/[email protected]
698-
699-
- name: Configure CMake to generate VERSION
700-
shell: bash
701-
working-directory: ${{github.workspace}}/build
702-
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE
703-
704-
- name: Get VERSION
705-
id: build
706-
run: |
707-
echo "VERSION=`cat ${{github.workspace}}/build/VERSION`" >> $GITHUB_ENV
708-
709-
- name: Debug version
710-
run: echo ${{ env.VERSION }}
658+
659+
- name: Debug artifacts
660+
run: ls -lha .
711661

712662
- name: Generate ref tag (develop)
713663
if: ${{ env.BRANCH_NAME == 'develop' }}
@@ -716,9 +666,6 @@ jobs:
716666
echo "PRERELEASE=false" >> $GITHUB_ENV
717667
echo "DRAFT=true" >> $GITHUB_ENV
718668
719-
- name: Debug ref tag
720-
run: echo ${{ env.REF_TAG }}
721-
722669
- name: Login to GitHub Container Registry
723670
uses: docker/login-action@v1
724671
with:
@@ -829,33 +776,10 @@ jobs:
829776
terraform destroy -auto-approve
830777
831778
pushing-manifests:
832-
needs: [ remove-github-runner-arm64 ]
779+
needs: [ unit-tests-linux, remove-github-runner-arm64 ]
833780
runs-on: ubuntu-latest
834781
if: github.event_name != 'pull_request'
835-
steps:
836-
- name: Get branch name
837-
shell: bash
838-
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV
839-
840-
- name: Debug branch name
841-
run: echo ${{ env.BRANCH_NAME }}
842-
843-
- name: Create Build Environment
844-
run: cmake -E make_directory ${{github.workspace}}/build
845-
846-
- name: Get Conan
847-
uses: turtlebrowser/[email protected]
848-
849-
- name: Configure CMake to generate VERSION
850-
shell: bash
851-
working-directory: ${{github.workspace}}/build
852-
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE
853-
854-
- name: Get VERSION
855-
id: build
856-
run: |
857-
echo "VERSION=`cat ${{github.workspace}}/build/VERSION`" >> $GITHUB_ENV
858-
782+
steps:
859783
- name: Login to GitHub Container Registry
860784
uses: docker/login-action@v1
861785
with:
@@ -868,9 +792,6 @@ jobs:
868792
docker manifest create ghcr.io/ns1labs/pktvisor:latest-develop \
869793
ghcr.io/ns1labs/pktvisor:amd64 \
870794
ghcr.io/ns1labs/pktvisor:arm64
871-
docker manifest create ghcr.io/ns1labs/pktvisor:${{ env.VERSION }} \
872-
ghcr.io/ns1labs/pktvisor:amd64 \
873-
ghcr.io/ns1labs/pktvisor:arm64
874795
875796
- name: Push manifest to ghcr.io
876797
run: |
@@ -897,7 +818,7 @@ jobs:
897818
docker://docker.io/ns1labs/pktvisor:latest-develop
898819
sudo skopeo copy \
899820
--all \
900-
docker://ghcr.io/ns1labs/pktvisor:${{ env.VERSION }} \
901-
docker://docker.io/ns1labs/pktvisor:${{ env.VERSION }}
821+
docker://ghcr.io/ns1labs/pktvisor:latest-develop \
822+
docker://docker.io/ns1labs/pktvisor:${{ needs.unit-tests-linux.outputs.version_number }}
902823
903824

0 commit comments

Comments
 (0)