diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..58b4c0e6 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,47 @@ +name: CI + +on: [push] + +jobs: + test-core: + strategy: + matrix: + os: [ubuntu-latest, windows-latest] + haxe-version: [4.2.2] + node-version: ['14'] + python-version: ['3.x'] + test-target: + - KISS_TARGET=cpp + - KISS_TARGET=interp + - KISS_TARGET=js + - KISS_TARGET=nodejs + - KISS_TARGET=py + - KISS_PROJECT=aoc + - KISS_PROJECT=asciilib2 + - KISS_PROJECT=file-watch + - KISS_PROJECT=flixel-ascii-game + - KISS_PROJECT=flixel-rpg-tutorial + - KISS_PROJECT=kiss-vscode + - KISS_PROJECT=nat-archive-tool + - KISS_PROJECT=nat-cli + - KISS_PROJECT=pdf-salad + fail-fast: true + runs-on: ${{ matrix.os }} + env: + CI_OS_NAME: ${{matrix.os}} + steps: + - uses: actions/checkout@v2 + # Set up Kiss runtimes: + - uses: krdlab/setup-haxe@v1.1.5 + with: + haxe-version: ${{ matrix.haxe-version }} + - uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + - uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - run: haxe -version + - run: echo "${{ matrix.test-target }}" >> $GITHUB_ENV + - run: ./test.sh + diff --git a/projects/file-watch/test.sh b/projects/file-watch/test.sh index 206d2a7d..139ab51f 100755 --- a/projects/file-watch/test.sh +++ b/projects/file-watch/test.sh @@ -2,7 +2,7 @@ echo "" > test-output.txt expected=$'hey\nhey\nhey' -if [[ $(uname) == *"MINGW"* ]] || [ $TRAVIS_OS_NAME = "windows" ]; then +if [[ $(uname) == *"MINGW"* ]] || [ $CI_OS_NAME = "windows-latest" ]; then expected=$'"hey" \r\n"hey" \r\n"hey"' fi diff --git a/projects/pdf-salad/test.sh b/projects/pdf-salad/test.sh index 998c0b91..18055a0e 100755 --- a/projects/pdf-salad/test.sh +++ b/projects/pdf-salad/test.sh @@ -1,11 +1,11 @@ #! /bin/bash # Something is broken in the Node dependencies on Mac, so don't bother. -if [ "$TRAVIS_OS_NAME" = "osx" ]; then +if [ "$CI_OS_NAME" = "macos-latest" ]; then exit 0 fi -if [ ! -z "$TRAVIS_OS_NAME" ]; then +if [ ! -z "$CI_OS_NAME" ]; then npm install pdf-lib haxelib install hxnodejs fi diff --git a/test-project.sh b/test-project.sh index d637f7c1..5d36f80d 100755 --- a/test-project.sh +++ b/test-project.sh @@ -21,7 +21,7 @@ fi if [[ $KISS_PROJECT == *flixel-* ]] then # If running through Travis, install HaxeFlixel with c++ tooling and - if [ ! -z "$TRAVIS_OS_NAME" ] + if [ ! -z "CI_OS_NAME" ] then haxelib install lime haxelib install openfl diff --git a/test.sh b/test.sh index 099b0fbc..12441773 100755 --- a/test.sh +++ b/test.sh @@ -4,7 +4,7 @@ KISS_TARGET=${KISS_TARGET:-$1} KISS_TARGET=${KISS_TARGET:-interp} # If Travis is running tests, basic dependencies need to be installed -if [ ! -z "$TRAVIS_OS_NAME" ] +if [ ! -z "$CI_OS_NAME" ] then (cd kiss/build-scripts && haxelib install all --always) (cd kiss/build-scripts/$KISS_TARGET && haxelib install all --always)