From 491dd4f8c0d4e8b5088580c2dfba37cb0fd5b952 Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Tue, 9 May 2023 08:25:33 +1000 Subject: [PATCH 1/5] Draft test multi builder --- .github/workflows/build.yml | 76 +++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f922cfe..d0b8d7f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -64,3 +64,79 @@ jobs: path: | build/tools/blisp/blisp if-no-files-found: error + + build-linux-alternative-arch: + runs-on: ubuntu-latest + name: Build on ${{ matrix.distro }} ${{ matrix.arch }} + + # Run steps on a matrix of 4 arch/distro combinations + strategy: + matrix: + include: + - arch: aarch64 + distro: ubuntu_latest + - arch: armv7 + distro: ubuntu_latest + - arch: riscv64 + distro: ubuntu_latest + steps: + - uses: actions/checkout@v3 + - uses: uraimo/run-on-arch-action@v2 + name: Build artifact + id: build + with: + arch: ${{ matrix.arch }} + distro: ${{ matrix.distro }} + + # Create an artifacts directory + setup: | + mkdir -p "${PWD}/artifacts" + + # Mount the artifacts directory as /artifacts in the container + dockerRunArgs: | + --volume "${PWD}/artifacts:/artifacts" + + # Pass some environment variables to the container + env: | # YAML, but pipe character is necessary + artifact_name: blisp-${{ matrix.distro }}_${{ matrix.arch }} + + # The shell to run commands with in the container + shell: /bin/sh + + # Install some dependencies in the container. This speeds up builds if + # you are also using githubToken. Any dependencies installed here will + # be part of the container image that gets cached, so subsequent + # builds don't have to re-install them. The image layer is cached + # publicly in your project's package repository, so it is vital that + # no secrets are present in the container state or logs. + install: | + case "${{ matrix.distro }}" in + ubuntu*|jessie|stretch|buster|bullseye) + apt-get update -q -y + apt-get install -q -y git cmake build-essential + ;; + esac + + # Produce a binary artifact and place it in the mounted volume + run: | + git submodule update --init --recursive + mkdir build + cd build + cmake .. -DBLISP_BUILD_CLI=ON -DCMAKE_BUILD_TYPE=Release + cmake --build . + ls -lah build/tools/blisp/ + cp build/tools/blisp/blisp "/artifacts/${artifact_name}" + echo "Produced artifact at /artifacts/${artifact_name}" + + - name: Show the artifact + # Items placed in /artifacts in the container will be in + # ${PWD}/artifacts on the host. + run: | + ls -al "${PWD}/artifacts" + + - name: Upload results + uses: actions/upload-artifact@v2 + with: + path: | + build/tools/blisp/* + if-no-files-found: error From 729609f2c0f9f2bbcdba80a4fc2c1e8d81e02872 Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Tue, 9 May 2023 08:33:59 +1000 Subject: [PATCH 2/5] Use Actions to recursively checkout --- .github/workflows/build.yml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d0b8d7f..1387b69 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,11 +8,12 @@ jobs: run: shell: cmd steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + with: + submodules: 'recursive' - uses: lukka/get-cmake@latest - name: Build blisp tool run: | - git submodule update --init --recursive mkdir build cd build cmake .. -DBLISP_BUILD_CLI=ON -DCMAKE_BUILD_TYPE=Release @@ -28,11 +29,12 @@ jobs: build-macos: runs-on: macos-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + with: + submodules: 'recursive' - uses: lukka/get-cmake@latest - name: Build blisp tool run: | - git submodule update --init --recursive mkdir build cd build cmake .. -DBLISP_BUILD_CLI=ON -DCMAKE_BUILD_TYPE=Release @@ -48,11 +50,12 @@ jobs: build-linux: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + with: + submodules: 'recursive' - uses: lukka/get-cmake@latest - name: Build blisp tool run: | - git submodule update --init --recursive mkdir build cd build cmake .. -DBLISP_BUILD_CLI=ON -DCMAKE_BUILD_TYPE=Release @@ -81,6 +84,8 @@ jobs: distro: ubuntu_latest steps: - uses: actions/checkout@v3 + with: + submodules: 'recursive' - uses: uraimo/run-on-arch-action@v2 name: Build artifact id: build @@ -119,7 +124,7 @@ jobs: # Produce a binary artifact and place it in the mounted volume run: | - git submodule update --init --recursive + git config --global --add safe.directory /home/runner/work/blisp/blisp mkdir build cd build cmake .. -DBLISP_BUILD_CLI=ON -DCMAKE_BUILD_TYPE=Release From f6f2013c8ed3bee86a2ab03ac2694a1b81aa4986 Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Tue, 9 May 2023 14:11:35 +1000 Subject: [PATCH 3/5] Upload with specific names --- .github/workflows/build.yml | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1387b69..dd85d1a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -103,7 +103,7 @@ jobs: # Pass some environment variables to the container env: | # YAML, but pipe character is necessary - artifact_name: blisp-${{ matrix.distro }}_${{ matrix.arch }} + artifact_name: blisp-linux-${{ matrix.arch }} # The shell to run commands with in the container shell: /bin/sh @@ -128,20 +128,14 @@ jobs: mkdir build cd build cmake .. -DBLISP_BUILD_CLI=ON -DCMAKE_BUILD_TYPE=Release - cmake --build . - ls -lah build/tools/blisp/ - cp build/tools/blisp/blisp "/artifacts/${artifact_name}" + cmake --build . -j2 + cp ./tools/blisp/blisp "/artifacts/${artifact_name}" echo "Produced artifact at /artifacts/${artifact_name}" - - name: Show the artifact - # Items placed in /artifacts in the container will be in - # ${PWD}/artifacts on the host. - run: | - ls -al "${PWD}/artifacts" - - name: Upload results uses: actions/upload-artifact@v2 with: + name: blisp-linux-${{ matrix.arch }} path: | - build/tools/blisp/* + artifacts/blisp-* if-no-files-found: error From 33c3f36b986654e7d1b4ac914c574a8a58f76587 Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Tue, 9 May 2023 14:31:37 +1000 Subject: [PATCH 4/5] update upload artifact --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dd85d1a..1d28cee 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,7 +19,7 @@ jobs: cmake .. -DBLISP_BUILD_CLI=ON -DCMAKE_BUILD_TYPE=Release cmake --build . --config Release - name: Upload results - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: blisp Windows x64 build path: | @@ -40,7 +40,7 @@ jobs: cmake .. -DBLISP_BUILD_CLI=ON -DCMAKE_BUILD_TYPE=Release cmake --build . - name: Upload results - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: blisp macOS x64 build path: | @@ -61,7 +61,7 @@ jobs: cmake .. -DBLISP_BUILD_CLI=ON -DCMAKE_BUILD_TYPE=Release cmake --build . - name: Upload results - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: blisp Linux x64 build path: | @@ -133,7 +133,7 @@ jobs: echo "Produced artifact at /artifacts/${artifact_name}" - name: Upload results - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: blisp-linux-${{ matrix.arch }} path: | From ec078224bd9cb62ce3afb9e00e9dcf5fbf50e66b Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Tue, 9 May 2023 14:38:58 +1000 Subject: [PATCH 5/5] Unify uploaded artefact names --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1d28cee..0ae1226 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,7 +21,7 @@ jobs: - name: Upload results uses: actions/upload-artifact@v3 with: - name: blisp Windows x64 build + name: blips-windows-x86_64.zip path: | build/tools/blisp/Release/blisp.exe if-no-files-found: error @@ -42,7 +42,7 @@ jobs: - name: Upload results uses: actions/upload-artifact@v3 with: - name: blisp macOS x64 build + name: blips-apple-x86_64.zip path: | build/tools/blisp/blisp if-no-files-found: error @@ -63,7 +63,7 @@ jobs: - name: Upload results uses: actions/upload-artifact@v3 with: - name: blisp Linux x64 build + name: blips-linux-x86_64.zip path: | build/tools/blisp/blisp if-no-files-found: error @@ -135,7 +135,7 @@ jobs: - name: Upload results uses: actions/upload-artifact@v3 with: - name: blisp-linux-${{ matrix.arch }} + name: blisp-linux-${{ matrix.arch }}.zip path: | artifacts/blisp-* if-no-files-found: error