Skip to content

p3(http): Add guest tests for request options #100

p3(http): Add guest tests for request options

p3(http): Add guest tests for request options #100

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
permissions: {}
defaults:
run:
shell: bash
jobs:
tests:
name: Tests (${{ matrix.os }})
runs-on: ${{ matrix.os }}
permissions:
contents: read
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
steps:
- name: Check out repository code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Install just
uses: taiki-e/cache-cargo-install-action@417450f3c33ee20393705369577571770643d4c7 # v3.0.7
with:
tool: just
- name: Install DotSlash
uses: facebook/install-dotslash@1e4e7b3e07eaca387acb98f1d4720e0bee8dbb6a # v2
- name: Configure Buck2 launcher on Windows
if: runner.os == 'Windows'
run: |
echo 'BUCK2=dotslash ./buck2' >> "$GITHUB_ENV"
echo 'MSYS2_ARG_CONV_EXCL=//' >> "$GITHUB_ENV"
- name: Run Starlark lint
run: just lint-starlark
- name: Lint TypeScript
if: runner.os == 'Linux'
run: just lint-ts
- name: Check formatting
if: runner.os == 'Linux'
run: just fmt-check
- name: Run Wasmtime Buck tests
run: just test
- name: Run jco Buck tests
run: just test-jco
- name: Run extra Buck runtime tests
if: runner.os == 'Linux'
run: just test-extra-runtimes
- name: Build dist archive
run: just dist
- name: Copy dist archive
if: runner.os == 'Linux'
run: |
mkdir -p dist-artifact
cp "$(./buck2 build --show-output //tests:dist | awk '/root\/\/tests:dist/{print $2}')" dist-artifact/wasi-testsuite.tar.gz
- name: Upload dist archive
if: runner.os == 'Linux'
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: wasi-testsuite-dist
path: dist-artifact/wasi-testsuite.tar.gz
if-no-files-found: error
publish-test-binaries:
if: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }}
runs-on: ubuntu-latest
needs: [tests]
permissions:
contents: write
steps:
- name: Check out repository code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: false
ref: prod/testsuite-base
- name: Configure git
uses: ./.github/actions/git-config
- name: Merge main branch changes
run: |
git merge --no-commit --strategy ours ${{ github.sha }}
git checkout --no-overlay ${{ github.sha }} .
git checkout HEAD tests/assemblyscript/testsuite
git checkout HEAD tests/c/testsuite
git checkout HEAD tests/rust/testsuite
git diff --quiet HEAD || git commit -m "Merge commit ${{ github.sha }} into prod/testsuite-base"
- name: Download dist archive
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: wasi-testsuite-dist
- name: Extract dist archive
run: |
mkdir -p dist
tar -xzf wasi-testsuite.tar.gz -C dist
- name: Remove existing binaries
run: |
rm -rf tests/assemblyscript/testsuite
rm -rf tests/c/testsuite
rm -rf tests/rust/testsuite
- name: Copy Buck-built test binaries
run: |
cp -R dist/wasi-testsuite/tests/assemblyscript/testsuite tests/assemblyscript/testsuite
cp -R dist/wasi-testsuite/tests/c/testsuite tests/c/testsuite
cp -R dist/wasi-testsuite/tests/rust/testsuite tests/rust/testsuite
- name: Publish changes to consumer branch
shell: bash
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
git add -f tests/assemblyscript/testsuite
git add -f tests/c/testsuite
git add -f tests/rust/testsuite
git diff --quiet HEAD || git commit -m "Update prebuilt test binaries after commit ${{ github.sha }}"
auth="$(printf 'x-access-token:%s' "$GITHUB_TOKEN" | base64 | tr -d '\n')"
git -c "http.https://github.com/.extraheader=AUTHORIZATION: basic $auth" push origin HEAD:prod/testsuite-base