commit 0617f390aba323f058a118597dd3c3ac459d8578 parent 1bf7e72b573aaf8355a5037577b832ad839f5eec Author: finwo <finwo@pm.me> Date: Tue, 24 Oct 2023 00:25:01 +0200 Extend CI to test on windows as well Diffstat:
| M | .github/workflows/cc.yml | | | 118 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------- |
1 file changed, 103 insertions(+), 15 deletions(-)
diff --git a/.github/workflows/cc.yml b/.github/workflows/cc.yml @@ -1,26 +1,114 @@ --- -name: C/C++ CI - +name: Build on: - - push + push: + tags: + - '*' jobs: - build: + build-windows: + name: Build & test + runs-on: ${{ matrix.os }} + strategy: + matrix: + include: + - os: windows-latest + cc: clang + bin: fnet_test.exe + steps: + - uses: actions/checkout@v3 + + - shell: bash + run: | + echo "/c/msys64/mingw64/bin" >> $GITHUB_PATH + + - uses: finwo/dep@main + name: Install dep + + - name: Install dependencies + run: dep install + shell: bash + + - name: Build + run: make CC=${{ matrix.cc }} BIN=${{ matrix.bin }} + shell: bash + + - name: Upload binaries to release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: ${{ matrix.bin }} + file_glob: true + overwrite: true + tag: ${{ github.ref }} + + build-linux: + name: Build & test runs-on: ubuntu-latest + strategy: + matrix: + include: + + - distro: ubuntu_latest + arch: aarch64 + cc: gcc + bin: fnet_test-aarch64 + + - distro: ubuntu_latest + arch: armv7 + cc: gcc + bin: fnet_test-armv7 + + - distro: ubuntu_latest + arch: riscv64 + cc: gcc + bin: fnet_test-riscv64 + + - distro: ubuntu_latest + arch: none + cc: gcc + bin: fnet_test-x86_64 steps: + - uses: actions/checkout@v3 - - name: Install @finwo/dep - uses: finwo/dep@edge - # - name: configure - # run: ./configure + + - uses: finwo/dep@main + name: Install dep + - name: Install dependencies - run: dep i - - name: make - run: make - - name: make check - run: make check -# - name: make distcheck -# run: make distcheck + run: dep install + shell: bash + + - if: ${{ matrix.arch != 'none' }} + uses: uraimo/run-on-arch-action@v2 + name: Build + id: runcmd + with: + arch: ${{ matrix.arch }} + distro: ${{ matrix.distro }} + githubToken: ${{ github.token }} + + install: | + apt-get update -yq + apt-get install -yq build-essential + + run: | + make CC=${{ matrix.cc }} BIN=${{ matrix.bin }} + + - if: ${{ matrix.arch == 'none' }} + name: Build + shell: bash + run: | + make CC=${{ matrix.cc }} BIN=${{ matrix.bin }} + + - name: Upload binaries to release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: ${{ matrix.bin }} + file_glob: true + overwrite: true + tag: ${{ github.ref }}