From 892f8f1add9ffa53b7de1cc7805d1d9a8f0fe8fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alfonso=20Subiotto=20Marqu=C3=A9s?= Date: Fri, 31 May 2024 13:45:05 +0200 Subject: [PATCH] workflows: add DST workflow (#883) This change adds a workflow that downloads the custom go release at `polarsignals/go` and runs the test in ./dst on WASM with wasmtime. --- .github/workflows/dst.yml | 46 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/dst.yml diff --git a/.github/workflows/dst.yml b/.github/workflows/dst.yml new file mode 100644 index 000000000..0582ecb59 --- /dev/null +++ b/.github/workflows/dst.yml @@ -0,0 +1,46 @@ +name: DST + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + dst: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + run: | + curl -L -o go-custom-linux-amd64.tar.gz https://github.com/polarsignals/go/releases/download/v0.0.1/go-custom-linux-amd64.tar.gz + tar -xzf go-custom-linux-amd64.tar.gz + sudo mv go /usr/local/go + echo "/usr/local/go/bin" >> $GITHUB_PATH + echo "GOROOT=/usr/local/go" >> $GITHUB_ENV + + - name: Setup `wasmtime` + uses: bytecodealliance/actions/wasmtime/setup@v1 + + - name: Setup Go module cache + uses: actions/cache@v4 + with: + path: | + ~/.cache/go-build + ~/go/pkg/mod + key: ${{ runner.os }}-golang-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-golang- + + - name: Run DST Test + run: | + iterations=10 + for ((i=0; i < iterations; i++)) + do + export GORANDSEED=$RANDOM$RANDOM$RANDOM$RANDOM$RANDOM$RANDOM + # ldflags=-checklinkname=0 is required for parquet-go to build with + # Go 1.23. + echo "Running DST test iteration $((i+1))/${iterations} with GORANDSEED=${GORANDSEED}" + GOOS=wasip1 GOARCH=wasm go test -ldflags=-checklinkname=0 -tags=faketime --exec="$GOROOT/misc/wasm/go_wasip1_wasm_exec -S inherit-env=y" ./dst + done