From 6ebbd72d4fe04eff5679cd8f8424137145dc4f78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radek=20Barto=C5=88?= Date: Wed, 7 Feb 2024 10:34:27 +0100 Subject: [PATCH] tmp --- .github/scripts/build-hello-world.sh | 19 +++++++++++++++ .github/scripts/install-toolchain.sh | 21 ++++++++++++---- .github/workflows/check-repository.yml | 33 +++++++++++++++++++------- .github/workflows/main.yml | 4 ++++ 4 files changed, 64 insertions(+), 13 deletions(-) create mode 100755 .github/scripts/build-hello-world.sh diff --git a/.github/scripts/build-hello-world.sh b/.github/scripts/build-hello-world.sh new file mode 100755 index 0000000..3354625 --- /dev/null +++ b/.github/scripts/build-hello-world.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +set -e # exit on error +set -x # echo on +set -o pipefail # fail of any command in pipeline is an error + +tree -h /opt/bin +which aarch64-w64-mingw32-gcc + +# Sanity check of the GCC binary and its version. +aarch64-w64-mingw32-gcc --version + +# Create a simple "Hello, World!" program binary. +echo '#include + int main() { + printf("Hello, World!\n"); + return 0; + }' > hello-world.c +aarch64-w64-mingw32-gcc -o hello-world.exe hello-world.c diff --git a/.github/scripts/install-toolchain.sh b/.github/scripts/install-toolchain.sh index b4b90aa..176abae 100755 --- a/.github/scripts/install-toolchain.sh +++ b/.github/scripts/install-toolchain.sh @@ -1,8 +1,19 @@ +#!/bin/bash + +set -e # exit on error +set -x # echo on +set -o pipefail # fail of any command in pipeline is an error + pacman -Syu --noconfirm -cat "[woarm64] - Server = https://windows-on-arm-experiments.github.io/msys2-woarm64-build/$arch - SigLevel = Optional" >> /etc/pacman.conf +REPO="[woarm64] +Server = https://windows-on-arm-experiments.github.io/msys2-woarm64-build/x86_64 +SigLevel = Optional +" +echo -e "$REPO$(cat /etc/pacman.conf)" > /etc/pacman.conf + +pacman -Sy --noconfirm +pacman -S mingw-w64-cross-gcc --noconfirm -pacman -Sy -pacman -S mingw-w64-cross-gcc +pacman -S tree --noconfirm +tree -h /opt/bin diff --git a/.github/workflows/check-repository.yml b/.github/workflows/check-repository.yml index e7de2d8..fbdc4d8 100644 --- a/.github/workflows/check-repository.yml +++ b/.github/workflows/check-repository.yml @@ -3,23 +3,40 @@ name: Check MSYS2 repository on: pull_request: workflow_dispatch: + workflow_call: jobs: - check-repository: - runs-on: ubuntu-latest + build: + runs-on: windows-latest steps: - uses: msys2/setup-msys2@v2 with: msystem: MSYS - location: ${{ github.workspace }} - release: true update: true - cache: false - install: base-devel - name: Checkout repository uses: actions/checkout@v4 - - shell: msys2 {0} + - name: Install toolchain + shell: msys2 {0} run: | - .github/workflows/install-toolchain.sh + `cygpath "${{ github.workspace }}"`/.github/scripts/install-toolchain.sh + + - name: Build hello-world.exe + shell: msys2 {0} + run: | + `cygpath "${{ github.workspace }}"`/.github/scripts/build-hello-world.sh + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: hello-world + path: hello-world.exe + + test: + needs: [build] + runs-on: [Windows, GCC, ARM64] + + steps: + - name: Checkout repository + uses: actions/checkout@v4 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5c57e4e..b29c7e3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -472,3 +472,7 @@ jobs: uses: actions/deploy-pages@v4 with: artifact_name: woarm64-msys2-repository + + check-repository: + needs: [deploy] + uses: .github/workflows/check-repository.yml