Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
Blackhex committed Feb 8, 2024
1 parent 1658373 commit 0d9d26a
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 14 deletions.
19 changes: 19 additions & 0 deletions .github/scripts/build-hello-world.sh
Original file line number Diff line number Diff line change
@@ -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 <stdio.h>
int main() {
printf("Hello, World!\n");
return 0;
}' > hello-world.c
aarch64-w64-mingw32-gcc -o hello-world.exe hello-world.c
21 changes: 16 additions & 5 deletions .github/scripts/install-toolchain.sh
Original file line number Diff line number Diff line change
@@ -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
34 changes: 25 additions & 9 deletions .github/workflows/check-repository.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,39 @@ 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
4 changes: 4 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 0d9d26a

Please sign in to comment.