diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 8205d88c..7a39c792 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -27,6 +27,10 @@ jobs: - false zmq_version: - 4.3.4 + docker: + - "" + docker_cmd: + - "" include: - os: windows-2022 @@ -61,6 +65,16 @@ jobs: zmq_draft: false zmq_version: 4.3.4 + - os: ubuntu-22.04 + docker: node:18-alpine + docker_cmd: apk add --no-cache pkgconfig curl tar python3 make gcc g++ cmake musl-dev && npm i -g pnpm && pnpm install && pnpm run prebuild + node_version: 18 + node_arch: x64 + ARCH: x64 + cpp_arch: x64 + zmq_draft: false + zmq_version: 4.3.4 + env: ZMQ_VERSION: ${{ matrix.zmq_version }} ZMQ_DRAFT: ${{ matrix.zmq_draft }} @@ -80,18 +94,20 @@ jobs: "cache-OS:${{ matrix.os }}-arch:${{ matrix.node_arch }}-ZMQ_DRAFT:${{ matrix.zmq_draft }}-ZMQ_VERSION:${{ matrix.zmq_version }}-Node:${{ matrix.node_version }}-" - name: Setup Cpp + if: ${{ !matrix.docker }} uses: aminya/setup-cpp@v1 with: vcvarsall: ${{ contains(matrix.os, 'windows') }} cmake: true - ninja: true architecture: ${{ matrix.cpp_arch }} - uses: pnpm/action-setup@v2.2.4 + if: ${{ !matrix.docker }} with: version: 7 - name: Install Node + if: ${{ !matrix.docker }} uses: actions/setup-node@v3 with: node-version: ${{ matrix.node_version }} @@ -104,21 +120,32 @@ jobs: brew install libsodium gnutls - name: Install Dependencies and Build + if: ${{ !matrix.docker }} run: pnpm install - name: Prebuild + if: ${{ !matrix.docker }} run: pnpm run prebuild + - name: Prebuild Docker + if: ${{ matrix.docker }} + run: | + docker login -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }} ghcr.io + docker pull ${{ matrix.docker }} + docker tag ${{ matrix.docker }} builder + docker run --volume ${{ github.workspace }}:/app --workdir /app --privileged builder sh -c "${{ matrix.docker_cmd }}" + - name: Upload artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: path: ./prebuilds - name: Lint - if: contains(matrix.os, 'ubuntu') + if: "${{ contains(matrix.os, 'ubuntu') && !matrix.docker }}" run: pnpm run lint-test - name: Test (Debug) + if: ${{ !matrix.docker }} uses: nick-fields/retry@v2 with: timeout_minutes: 15 @@ -128,6 +155,7 @@ jobs: pnpm run test.skip_gc_tests - name: Tests + GC Tests (Release) + if: ${{ !matrix.docker }} run: | pnpm run clean pnpm run test