mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-21 16:04:09 -08:00
Add GitHub Actions CI (#854)
This commit is contained in:
parent
5336fc9b3c
commit
f5f8135a42
45
.github/workflows/ci.yml
vendored
Normal file
45
.github/workflows/ci.yml
vendored
Normal file
|
@ -0,0 +1,45 @@
|
|||
on:
|
||||
pull_request:
|
||||
push:
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform:
|
||||
- c
|
||||
- js
|
||||
- wasm
|
||||
- wasi
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: 11
|
||||
distribution: adopt
|
||||
- uses: gradle/gradle-build-action@v2
|
||||
- if: ${{ matrix.platform == 'wasi' }}
|
||||
uses: bytecodealliance/actions/wasmtime/setup@v1
|
||||
- if: ${{ matrix.platform == 'wasi' }}
|
||||
run: |
|
||||
mkdir -p "$HOME/.wasmtime/bin/"
|
||||
echo 'wasmtime "$@"'> "$HOME/.wasmtime/bin/wasmtime"
|
||||
chmod +x "$HOME/.wasmtime/bin/wasmtime"
|
||||
- run: |
|
||||
platforms=("c" "js" "wasm" "wasi")
|
||||
args=()
|
||||
for v in "${platforms[@]}"
|
||||
do
|
||||
if [[ "${{ matrix.platform }}" != "$v" ]]; then
|
||||
args+=("-Pteavm.tests.${v}=false")
|
||||
fi
|
||||
done
|
||||
echo "${args[@]}"
|
||||
./gradlew "${args[@]}" build
|
||||
- uses: actions/upload-artifact@v3
|
||||
if: failure()
|
||||
with:
|
||||
name: "test-reports-${{ matrix.platform }}"
|
||||
path: "tests/build/reports/tests/test"
|
|
@ -1,3 +1,3 @@
|
|||
export LC_ALL=C
|
||||
SOURCE_DIR=$(pwd)
|
||||
gcc -g -O0 -lrt -lm all.c -o run_test
|
||||
gcc -g -O0 -lrt all.c -o run_test -lm
|
||||
|
|
Loading…
Reference in New Issue
Block a user