]> git.proxmox.com Git - wasi-libc.git/blob - .github/workflows/main.yml
`WASM_AR` -> `AR` to use standardized env var
[wasi-libc.git] / .github / workflows / main.yml
1 name: CI
2 on: [push, pull_request]
3
4 jobs:
5 buildlibc:
6 name: Build libc
7 runs-on: ${{ matrix.os }}
8 strategy:
9 matrix:
10 os: [ubuntu-latest, macos-latest, windows-latest]
11 steps:
12 - uses: actions/checkout@v1
13 with:
14 submodules: true
15
16 - name: Install LLVM tools (Windows)
17 shell: bash
18 run: |
19 curl -fsSLO https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/LLVM-10.0.0-win64.exe
20 7z x LLVM-10.0.0-win64.exe -y -o"llvm"
21 echo "$(pwd)/llvm/bin" >> $GITHUB_PATH
22 echo "CC=$(pwd)/llvm/bin/clang.exe" >> $GITHUB_ENV
23 echo "AR=$(pwd)/llvm/bin/llvm-ar.exe" >> $GITHUB_ENV
24 echo "WASM_NM=$(pwd)/llvm/bin/llvm-nm.exe" >> $GITHUB_ENV
25 if: matrix.os == 'windows-latest'
26
27 - name: Override llvm-nm with one from rustup (Windows)
28 run: |
29 rustup update stable
30 rustup default stable
31 rustup component add llvm-tools-preview
32 echo "WASM_NM=$(rustc --print sysroot|sed 's|C:|/c|'|sed 's|\\|/|g')/lib/rustlib/x86_64-pc-windows-msvc/bin/llvm-nm.exe" >> $GITHUB_ENV
33 if: matrix.os == 'windows-latest'
34
35 - name: Install LLVM tools (MacOS)
36 shell: bash
37 run: |
38 curl -sSfL https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/clang+llvm-10.0.0-x86_64-apple-darwin.tar.xz | tar xJf -
39 export CLANG_DIR=`pwd`/clang+llvm-10.0.0-x86_64-apple-darwin/bin
40 echo "$CLANG_DIR" >> $GITHUB_PATH
41 echo "CC=$CLANG_DIR/clang" >> $GITHUB_ENV
42 echo "AR=$CLANG_DIR/llvm-ar" >> $GITHUB_ENV
43 echo "WASM_NM=$CLANG_DIR/llvm-nm" >> $GITHUB_ENV
44 if: matrix.os == 'macos-latest'
45
46 - name: Install LLVM tools (Linux)
47 shell: bash
48 run: |
49 curl -sSfL https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz | tar xJf -
50 export CLANG_DIR=`pwd`/clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04/bin
51 echo "$CLANG_DIR" >> $GITHUB_PATH
52 echo "CC=$CLANG_DIR/clang" >> $GITHUB_ENV
53 echo "AR=$CLANG_DIR/llvm-ar" >> $GITHUB_ENV
54 echo "WASM_NM=$CLANG_DIR/llvm-nm" >> $GITHUB_ENV
55 if: matrix.os == 'ubuntu-latest'
56
57 - name: Build libc
58 shell: bash
59 run: make -j4
60
61 - uses: actions/upload-artifact@v1
62 with:
63 # Upload the sysroot folder. Give it a name according to the OS it was built for.
64 name: ${{ format( 'sysroot-{0}.tgz', matrix.os) }}
65 path: sysroot
66
67 # Disable the headerstest job for now, while WASI transitions from the
68 # witx snapshots to wit proposals, and we have a few manual edits to the
69 # generated header to make life easier for folks.
70 headerstest:
71 if: ${{ false }} # Disable the headers test for now.
72 name: wasi-headers test
73 runs-on: ${{ matrix.os }}
74 strategy:
75 matrix:
76 os: [ubuntu-latest, macos-latest, windows-latest]
77 steps:
78 - uses: actions/checkout@v1
79 with:
80 submodules: true
81 - name: Install Rust (rustup)
82 shell: bash
83 run: rustup update stable --no-self-update && rustup default stable
84 if: matrix.os != 'macos-latest'
85 - name: Install Rust (macos)
86 run: |
87 curl https://sh.rustup.rs | sh -s -- -y
88 echo "$HOME/.cargo/bin" >> $GITHUB_PATH
89 if: matrix.os == 'macos-latest'
90 - run: cargo fetch
91 working-directory: tools/wasi-headers
92 - run: cargo build
93 working-directory: tools/wasi-headers
94 - run: cargo test
95 working-directory: tools/wasi-headers
96
97 rustfmt:
98 name: Rustfmt
99 runs-on: ubuntu-latest
100 steps:
101 - uses: actions/checkout@v1
102 with:
103 submodules: true
104 - name: Install Rust
105 run: rustup update stable && rustup default stable && rustup component add rustfmt
106 - run: cargo fmt -- --check
107 working-directory: tools/wasi-headers