2 on: [push, pull_request]
7 runs-on: ${{ matrix.os }}
10 os: [ubuntu-latest, macos-latest, windows-latest]
11 # oldest and newest supported LLVM version
12 clang_version: [10.0.0, 14.0.0]
14 - uses: actions/checkout@v1
18 - name: Install libtinfo5
22 sudo apt-get install -y libtinfo5
23 if: matrix.os == 'ubuntu-latest'
25 - name: Install LLVM tools (Windows)
28 curl -fsSLO https://github.com/llvm/llvm-project/releases/download/llvmorg-${{ matrix.clang_version }}/LLVM-${{ matrix.clang_version }}-win64.exe
29 7z x LLVM-${{ matrix.clang_version }}-win64.exe -y -o"llvm"
30 echo "$(pwd)/llvm/bin" >> $GITHUB_PATH
31 echo "CC=$(pwd)/llvm/bin/clang.exe" >> $GITHUB_ENV
32 echo "AR=$(pwd)/llvm/bin/llvm-ar.exe" >> $GITHUB_ENV
33 echo "NM=$(pwd)/llvm/bin/llvm-nm.exe" >> $GITHUB_ENV
34 if: matrix.os == 'windows-latest'
36 - name: Override llvm-nm with one from rustup (Windows)
40 rustup component add llvm-tools-preview
41 echo "NM=$(rustc --print sysroot|sed 's|C:|/c|'|sed 's|\\|/|g')/lib/rustlib/x86_64-pc-windows-msvc/bin/llvm-nm.exe" >> $GITHUB_ENV
42 if: matrix.os == 'windows-latest'
44 - name: Install LLVM tools (MacOS)
47 curl -sSfL https://github.com/llvm/llvm-project/releases/download/llvmorg-${{ matrix.clang_version }}/clang+llvm-${{ matrix.clang_version }}-x86_64-apple-darwin.tar.xz | tar xJf -
48 export CLANG_DIR=`pwd`/clang+llvm-${{ matrix.clang_version }}-x86_64-apple-darwin/bin
49 echo "$CLANG_DIR" >> $GITHUB_PATH
50 echo "CC=$CLANG_DIR/clang" >> $GITHUB_ENV
51 echo "AR=$CLANG_DIR/llvm-ar" >> $GITHUB_ENV
52 echo "NM=$CLANG_DIR/llvm-nm" >> $GITHUB_ENV
53 if: matrix.os == 'macos-latest'
55 - name: Install LLVM tools (Linux)
58 curl -sSfL https://github.com/llvm/llvm-project/releases/download/llvmorg-${{ matrix.clang_version }}/clang+llvm-${{ matrix.clang_version }}-x86_64-linux-gnu-ubuntu-18.04.tar.xz | tar xJf -
59 export CLANG_DIR=`pwd`/clang+llvm-${{ matrix.clang_version }}-x86_64-linux-gnu-ubuntu-18.04/bin
60 echo "$CLANG_DIR" >> $GITHUB_PATH
61 echo "CC=$CLANG_DIR/clang" >> $GITHUB_ENV
62 echo "AR=$CLANG_DIR/llvm-ar" >> $GITHUB_ENV
63 echo "NM=$CLANG_DIR/llvm-nm" >> $GITHUB_ENV
64 if: matrix.os == 'ubuntu-latest'
70 - uses: actions/upload-artifact@v1
72 # Upload the sysroot folder. Give it a name according to the OS it was built for.
73 name: ${{ format( 'sysroot-{0}.tgz', matrix.os) }}
76 - name: Build libc + threads
77 # Only build the thread-capable wasi-libc in the latest supported Clang
78 # version; the earliest version does not have all necessary builtins
79 # (e.g., `__builtin_wasm_memory_atomic_notify`).
80 if: matrix.clang_version != '10.0.0'
82 run: make -j4 THREAD_MODEL=posix
84 # Disable the headerstest job for now, while WASI transitions from the
85 # witx snapshots to wit proposals, and we have a few manual edits to the
86 # generated header to make life easier for folks.
88 if: ${{ false }} # Disable the headers test for now.
89 name: wasi-headers test
90 runs-on: ${{ matrix.os }}
93 os: [ubuntu-latest, macos-latest, windows-latest]
95 - uses: actions/checkout@v1
98 - name: Install Rust (rustup)
100 run: rustup update stable --no-self-update && rustup default stable
101 if: matrix.os != 'macos-latest'
102 - name: Install Rust (macos)
104 curl https://sh.rustup.rs | sh -s -- -y
105 echo "$HOME/.cargo/bin" >> $GITHUB_PATH
106 if: matrix.os == 'macos-latest'
108 working-directory: tools/wasi-headers
110 working-directory: tools/wasi-headers
112 working-directory: tools/wasi-headers
116 runs-on: ubuntu-latest
118 - uses: actions/checkout@v1
122 run: rustup update stable && rustup default stable && rustup component add rustfmt
123 - run: cargo fmt -- --check
124 working-directory: tools/wasi-headers