[feat] add cache #31
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
name: build h2o server | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
jobs: | |
buildH2oServer: | |
name: Build h2o server | |
if: "contains(github.event.head_commit.message, '[h2oBuild]')" | |
continue-on-error: false | |
strategy: | |
matrix: | |
target: | |
- id: 'linux-amd64' | |
os: 'ubuntu-24.04' | |
- id: 'darwin-amd64' | |
# os: 'macos-14-xlarge' ## failed | |
os: 'macos-14' | |
fail-fast: true | |
runs-on: ${{ matrix.target.os }} | |
steps: | |
- name: Check out the code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
- name: Install `deps` on Ubuntu | |
if: startsWith(matrix.target.id, 'linux-') | |
shell: bash | |
run: | | |
sudo apt install ninja-build build-essential autoconf automake tree clang cmake coreutils libidn2-0-dev pkg-config -y | |
echo "cpu core num is " | |
nproc | |
- name: Install `ninja llvm cmake ` on macOS | |
if: startsWith(matrix.target.id, 'darwin-') | |
shell: bash | |
run: | | |
brew install ninja llvm cmake tree libunistring libidn2 pkg-config autoconf automake libtool | |
clang --version | |
echo "BREW_INSTALL_PREFIX=$(brew --prefix llvm)" >> $GITHUB_ENV | |
echo "${BREW_INSTALL_PREFIX}/bin" | |
echo "/opt/homebrew/opt/llvm/bin" >> $GITHUB_PATH | |
clang --version | |
echo "llvm" | |
/opt/homebrew/opt/llvm/bin/clang --version | |
- name: test deps | |
if: startsWith(matrix.target.id, 'darwin-') || startsWith(matrix.target.id, 'linux-') | |
shell: bash | |
run: | | |
uname -a | |
clang --version | |
clang++ --version | |
- name: build h2o server | |
shell: bash | |
run: | | |
bash scripts/build_h2o.sh | |
- name: show layouts | |
shell: bash | |
run: | | |
tree -L 2 | |
ls -al | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.target.id }}-${{ matrix.target.os }}-prebuilt-h2o-server | |
path: dist | |
if-no-files-found: error | |
retention-days: 7 | |
buildh2oOpenwrt: | |
runs-on: ubuntu-latest | |
if: "contains(github.event.head_commit.message, '[h2oBuild]')" | |
container: | |
# image: docker://haldir65/hello-docker-hub:openwrt-toolchians-19.07.1 | |
image: ghcr.io/haldir65/upgraded-train:openwrt-19.07.1 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install `related deps` on Ubuntu | |
shell: bash | |
run: | | |
sudo apt install ninja-build build-essential autoconf automake libtool coreutils tree libidn2-0-dev pkg-config -y | |
echo "cpu core num is " | |
echo "cpu core num is " | |
echo "${STAGING_DIR}" | |
echo "${PATH}" | |
nproc | |
- name: show compiler layouts | |
shell: bash | |
run: | | |
tree ${STAGING_DIR} -L 3 | |
- name: build h2o static binary | |
shell: bash | |
run: | | |
tree -L 2 | |
chmod +x scripts/build_h2o_openwrt.sh | |
bash scripts/build_h2o_openwrt.sh | |
- name: examine binary info | |
shell: bash | |
run: | | |
tree prebuilt -L 2 | |
$STAGING_DIR/toolchain-mipsel_24kc_gcc-7.5.0_musl/bin/mipsel-openwrt-linux-readelf -a prebuilt/h2o/mipsel/bin/h2o | grep "NEEDED" | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: openwrt-prebuilt-h2o-server | |
path: dist | |
if-no-files-found: error | |
retention-days: 7 |