Initial commit. #11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: [push, pull_request] | |
name: Build & publish | |
jobs: | |
build: | |
if: ${{ !contains(github.event.head_commit.message, 'skip ci') }} | |
runs-on: ubuntu-latest | |
env: | |
RELEASE_BRANCH: ${{ startsWith(github.event.ref, 'refs/heads/develop-') || startsWith(github.event.ref, 'refs/heads/release-') }} | |
steps: | |
- name: Check out source code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: true # not recursive! | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip build | |
sudo apt update | |
sudo apt-get install flex bison ccache | |
- name: Set up caching | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/ccache | |
key: llvm-${{ hashFiles('llvm-src', 'build.sh') }} | |
restore-keys: | | |
llvm-${{ hashFiles('llvm-src', 'build.sh') }} | |
llvm- | |
- name: Set up ccache | |
run: | | |
ccache --max-size=10G -z | |
- name: Build WASM binaries | |
run: | | |
MAKEFLAGS=-j$(nproc) ./build.sh | |
- name: Build WASM artifact | |
run: | | |
tar cvf wasi-prefix.tar wasi-prefix | |
- name: Upload WASM artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist-prefix | |
path: wasi-prefix.tar | |
# ... snip... | |
- name: Print ccache statistics | |
run: | | |
ccache -s |