]> git.proxmox.com Git - wasi-libc.git/blob - .github/workflows/main.yml
ab9a7c18d1bc968907b6855ecf13bba0ef930961
[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 clang (Windows)
17 shell: bash
18 run: |
19 curl -fsSLO https://releases.llvm.org/8.0.0/LLVM-8.0.0-win64.exe
20 7z x LLVM-8.0.0-win64.exe -y -o"llvm"
21 echo "::add-path::$(pwd)/llvm/bin"
22 echo "::set-env name=WASM_AR::$(pwd)/llvm/bin/llvm-ar.exe"
23 if: matrix.os == 'windows-latest'
24
25 - name: Install llvm-nm (Windows)
26 shell: bash
27 run: |
28 # Add --no-self-update as a workaround for
29 # https://github.com/microsoft/azure-pipelines-image-generation/issues/1224
30 rustup update stable --no-self-update
31 rustup default stable
32 rustup component add llvm-tools-preview
33 echo "::set-env name=WASM_NM::$(rustc --print sysroot|sed 's|C:|/c|'|sed 's|\\|/|g')/lib/rustlib/x86_64-pc-windows-msvc/bin/llvm-nm.exe"
34 if: matrix.os == 'windows-latest'
35
36 - name: Install clang (MacOS)
37 shell: bash
38 run: |
39 curl -sSf http://releases.llvm.org/8.0.0/clang+llvm-8.0.0-x86_64-apple-darwin.tar.xz | tar xJf -
40 export CLANG_DIR=`pwd`/clang+llvm-8.0.0-x86_64-apple-darwin/bin
41 echo "::add-path::$CLANG_DIR"
42 echo "::set-env name=WASM_CC::$CLANG_DIR/clang"
43 if: matrix.os == 'macos-latest'
44
45 - name: Install clang (Linux)
46 shell: bash
47 run: |
48 curl -sSf http://releases.llvm.org/8.0.0/clang+llvm-8.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz | tar xJf -
49 export CLANG_DIR=`pwd`/clang+llvm-8.0.0-x86_64-linux-gnu-ubuntu-16.04/bin
50 echo "::add-path::$CLANG_DIR"
51 echo "::set-env name=WASM_CC::$CLANG_DIR/clang"
52 if: matrix.os == 'ubuntu-latest'
53
54 - name: Build libc
55 shell: bash
56 run: make -j4
57
58 - uses: actions/upload-artifact@v1
59 with:
60 # Upload the sysroot folder. Give it a name according to the OS it was built for.
61 name: ${{ format( 'sysroot-{0}.tgz', matrix.os) }}
62 path: sysroot
63
64 headerstest:
65 name: wasi-headers test
66 runs-on: ${{ matrix.os }}
67 strategy:
68 matrix:
69 os: [ubuntu-latest, macos-latest, windows-latest]
70 steps:
71 - uses: actions/checkout@v1
72 with:
73 submodules: true
74 - name: Install Rust (rustup)
75 shell: bash
76 run: rustup update stable --no-self-update && rustup default stable
77 if: matrix.os != 'macos-latest'
78 - name: Install Rust (macos)
79 run: |
80 curl https://sh.rustup.rs | sh -s -- -y
81 echo "##[add-path]$HOME/.cargo/bin"
82 if: matrix.os == 'macos-latest'
83 - run: cargo fetch
84 working-directory: tools/wasi-headers
85 - run: cargo build
86 working-directory: tools/wasi-headers
87 - run: cargo test
88 working-directory: tools/wasi-headers
89
90 rustfmt:
91 name: Rustfmt
92 runs-on: ubuntu-latest
93 steps:
94 - uses: actions/checkout@v1
95 with:
96 submodules: true
97 - name: Install Rust
98 run: rustup update stable && rustup default stable && rustup component add rustfmt
99 - run: cargo fmt -- --check
100 working-directory: tools/wasi-headers