-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add workflow checking that deployed repository can produce "Hello Wor…
…ld!" executable
- Loading branch information
Showing
4 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
set -e # exit on error | ||
set -x # echo on | ||
set -o pipefail # fail of any command in pipeline is an error | ||
|
||
# Sanity check of the GCC binary and its version. | ||
aarch64-w64-mingw32-gcc --version | ||
|
||
# Create a simple "Hello, World!" program binary. | ||
echo '#include <stdio.h> | ||
int main() { | ||
printf("Hello, World!\n"); | ||
return 0; | ||
} | ||
' > hello-world.c | ||
aarch64-w64-mingw32-gcc -o hello-world.exe hello-world.c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/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 | ||
|
||
# Add WoArm64 custom repository. | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Check MSYS2 repository | ||
|
||
on: | ||
workflow_dispatch: | ||
workflow_call: | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
steps: | ||
- uses: msys2/setup-msys2@v2 | ||
with: | ||
msystem: MSYS | ||
update: true | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install toolchain | ||
shell: msys2 {0} | ||
run: | | ||
`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: Download artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: hello-world | ||
path: ${{ github.workspace }}\artifacts | ||
|
||
- name: Run hello-world.exe | ||
run: | | ||
ls ${{ github.workspace }}\artifacts | ||
${{ github.workspace }}\artifacts\hello-world.exe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters