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 LLVM tools (Windows)
21 curl -fsSLO https://github.com/llvm/llvm-project/releases/download/llvmorg-${{ matrix.clang_version }}/LLVM-${{ matrix.clang_version }}-win64.exe
22 7z x LLVM-${{ matrix.clang_version }}-win64.exe -y -o"llvm"
23 echo "$(pwd)/llvm/bin" >> $GITHUB_PATH
24 echo "CC=$(pwd)/llvm/bin/clang.exe" >> $GITHUB_ENV
25 echo "AR=$(pwd)/llvm/bin/llvm-ar.exe" >> $GITHUB_ENV
26 echo "NM=$(pwd)/llvm/bin/llvm-nm.exe" >> $GITHUB_ENV
27 if: matrix.os == 'windows-latest'
29 - name: Override llvm-nm with one from rustup (Windows)
33 rustup component add llvm-tools-preview
34 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
35 if: matrix.os == 'windows-latest'
37 - name: Install LLVM tools (MacOS)
40 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 -
41 export CLANG_DIR=`pwd`/clang+llvm-${{ matrix.clang_version }}-x86_64-apple-darwin/bin
42 echo "$CLANG_DIR" >> $GITHUB_PATH
43 echo "CC=$CLANG_DIR/clang" >> $GITHUB_ENV
44 echo "AR=$CLANG_DIR/llvm-ar" >> $GITHUB_ENV
45 echo "NM=$CLANG_DIR/llvm-nm" >> $GITHUB_ENV
46 if: matrix.os == 'macos-latest'
48 - name: Install LLVM tools (Linux)
51 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 -
52 export CLANG_DIR=`pwd`/clang+llvm-${{ matrix.clang_version }}-x86_64-linux-gnu-ubuntu-18.04/bin
53 echo "$CLANG_DIR" >> $GITHUB_PATH
54 echo "CC=$CLANG_DIR/clang" >> $GITHUB_ENV
55 echo "AR=$CLANG_DIR/llvm-ar" >> $GITHUB_ENV
56 echo "NM=$CLANG_DIR/llvm-nm" >> $GITHUB_ENV
57 if: matrix.os == 'ubuntu-latest'
63 - uses: actions/upload-artifact@v1
65 # Upload the sysroot folder. Give it a name according to the OS it was built for.
66 name: ${{ format( 'sysroot-{0}.tgz', matrix.os) }}
69 # Disable the headerstest job for now, while WASI transitions from the
70 # witx snapshots to wit proposals, and we have a few manual edits to the
71 # generated header to make life easier for folks.
73 if: ${{ false }} # Disable the headers test for now.
74 name: wasi-headers test
75 runs-on: ${{ matrix.os }}
78 os: [ubuntu-latest, macos-latest, windows-latest]
80 - uses: actions/checkout@v1
83 - name: Install Rust (rustup)
85 run: rustup update stable --no-self-update && rustup default stable
86 if: matrix.os != 'macos-latest'
87 - name: Install Rust (macos)
89 curl https://sh.rustup.rs | sh -s -- -y
90 echo "$HOME/.cargo/bin" >> $GITHUB_PATH
91 if: matrix.os == 'macos-latest'
93 working-directory: tools/wasi-headers
95 working-directory: tools/wasi-headers
97 working-directory: tools/wasi-headers
101 runs-on: ubuntu-latest
103 - uses: actions/checkout@v1
107 run: rustup update stable && rustup default stable && rustup component add rustfmt
108 - run: cargo fmt -- --check
109 working-directory: tools/wasi-headers