Skip to content

Commit

Permalink
ci, use old os arch name
Browse files Browse the repository at this point in the history
  • Loading branch information
Cosmius committed Feb 14, 2024
1 parent 39f5b0d commit fc3fae0
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 49 deletions.
14 changes: 2 additions & 12 deletions .github/workflows/build.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
#!/bin/bash
#!/usr/bin/env bash

set -e

mkdir -p $UNIX_STACK_ROOT

case "$RUNNER_OS" in
Windows)
echo "local-programs-path: $STACK_ROOT\\programs" > $UNIX_STACK_ROOT/config.yaml
;;
*)
;;
esac

stack build --copy-bins --pedantic
stack build --pedantic
4 changes: 2 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ jobs:
- uses: actions/upload-artifact@v4
if: failure()
with:
name: x-test-${{ runner.os }}-${{ runner.arch }}
name: x-test-${{ GUGUGU_OS }}-${{ GUGUGU_ARCH }}
path: tmp/test
- run: bash .github/workflows/publish.sh
shell: bash
- uses: actions/upload-artifact@v4
with:
name: gugugu-${{ runner.os }}-${{ runner.arch }}
name: gugugu-${{ GUGUGU_OS }}-${{ GUGUGU_ARCH }}
path: build/release
4 changes: 2 additions & 2 deletions .github/workflows/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

set -e

ARCHIVE_NAME=gugugu-$GUGUGU_VERSION-$RUNNER_OS-$RUNNER_ARCH
ARCHIVE_NAME=gugugu-$GUGUGU_VERSION-$GUGUGU_OS-$GUGUGU_ARCH
PREPARING_DIR=build/preparing/$ARCHIVE_NAME
mkdir -p build/preparing/$ARCHIVE_NAME
stack $STACK_ARGS --local-bin-path=$PREPARING_DIR install
stack --local-bin-path=$PREPARING_DIR install

cp core/LICENSE $PREPARING_DIR/LICENSE
mkdir -p build/release
Expand Down
51 changes: 36 additions & 15 deletions .github/workflows/setup.sh
Original file line number Diff line number Diff line change
@@ -1,33 +1,48 @@
#!/bin/bash
#!/usr/bin/env bash

set -e

case "$RUNNER_ARCH" in
X64|ARM64)
;;
*)
echo "Unexpected RUNNER_ARCH=$RUNNER_ARCH"
exit 1
;;
esac

case "$RUNNER_OS" in
Linux|macOS)
Linux)
STACK_ROOT="$GITHUB_WORKSPACE/build/stack"
UNIX_STACK_ROOT="$STACK_ROOT"
STACK_BIN="$STACK_ROOT/bin"
GUGUGU_OS=linux
;;
macOS)
STACK_ROOT="$GITHUB_WORKSPACE/build/stack"
UNIX_STACK_ROOT="$STACK_ROOT"
GUGUGU_OS=darwin
;;
Windows)
STACK_ROOT="$GITHUB_WORKSPACE\\build\\stack"
UNIX_STACK_ROOT=$(cygpath --unix $STACK_ROOT)
STACK_BIN="$STACK_ROOT\\bin"
GUGUGU_OS=win32
mkdir -p $UNIX_STACK_ROOT
echo "local-programs-path: $STACK_ROOT\\programs" > $UNIX_STACK_ROOT/config.yaml
;;
*)
echo "Unexpected RUNNER_OS=$RUNNER_OS"
exit 1
GUGUGU_OS=unknown-$RUNNER_OS
echo "Unexpected RUNNER_OS=$RUNNER_OS, don't be suprised if it breaks"
;;
esac

case "$RUNNER_ARCH" in
X64)
GUGUGU_ARCH=amd64
;;
ARM64)
GUGUGU_ARCH=aarch64
;;
*)
GUGUGU_ARCH=unknown-$RUNNER_ARCH
echo "Unexpected RUNNER_ARCH=$RUNNER_ARCH, don't be suprised if it breaks"
;;
esac

if [ "$GUGUGU_OS-$GUGUGU_ARCH" = win32-aarch64 ]; then
echo "$GUGUGU_OS-$GUGUGU_ARCH is not supported, don't be suprised if it breaks"
fi

echo "Using STACK_ROOT = $STACK_ROOT"
echo "STACK_ROOT=$STACK_ROOT" >> "$GITHUB_ENV"
echo "STACK_ROOT=$STACK_ROOT" >> "$GITHUB_OUTPUT"
Expand All @@ -42,3 +57,9 @@ echo "STACK_RESOLVER=$STACK_RESOLVER" >> "$GITHUB_ENV"
GUGUGU_VERSION=$(grep -e "version:" hpack-common.yaml | xargs echo | cut -d " " -f 2)
echo "Using GUGUGU_VERSION = $GUGUGU_VERSION"
echo "GUGUGU_VERSION=$GUGUGU_VERSION" >> "$GITHUB_ENV"

echo "Using GUGUGU_OS = $GUGUGU_OS"
echo "GUGUGU_OS=$GUGUGU_OS" >> "$GITHUB_ENV"

echo "Using GUGUGU_ARCH = $GUGUGU_ARCH"
echo "GUGUGU_ARCH=$GUGUGU_ARCH" >> "$GITHUB_ENV"
35 changes: 17 additions & 18 deletions .github/workflows/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,31 @@

set -e

case "$RUNNER_OS" in
Linux|macOS)
PYTHON=python3
LOCAL_INSTALL_ROOT=$(stack path --local-install-root)
;;
Windows)
PYTHON=python
case "$GUGUGU_OS" in
win32)
function python3 () {
python $@
}
LOCAL_INSTALL_ROOT=$(cygpath -u $(stack path --local-install-root))
echo "Using Python at $(which python):"
;;
*)
echo "Unexpected RUNNER_OS=$RUNNER_OS"
exit 1
LOCAL_INSTALL_ROOT=$(stack path --local-install-root)
echo "Using Python at $(which python3):"
;;
esac

export PATH=$LOCAL_INSTALL_ROOT/bin:$PATH

echo "Using Python at $(which $PYTHON):"
$PYTHON --version
python3 --version

$PYTHON -m pip install -U pip setuptools wheel
$PYTHON -m pip install -r scripts/requirements.txt
python3 -m pip install -U pip setuptools wheel
python3 -m pip install -r scripts/requirements.txt

for EXAMPLE_BUILD in $(ls -d examples/lang/*/build.sh)
do
bash $EXAMPLE_BUILD
done
bash examples/lang/haskell/build.sh
bash examples/lang/scala/build.sh
bash examples/lang/rust/build.sh
bash examples/lang/typescript/build.sh
bash examples/lang/python/build.sh

$PYTHON scripts/test_examples.py -vvv
python3 scripts/test_examples.py -vvv

0 comments on commit fc3fae0

Please sign in to comment.