From 03918f94439264fe656363ca9e81962b776c8d9a Mon Sep 17 00:00:00 2001 From: Travis Glenn Hansen Date: Mon, 21 Feb 2022 11:09:01 -0700 Subject: [PATCH] attempt to build once and use artifacts for ci Signed-off-by: Travis Glenn Hansen --- .github/workflows/main.yml | 48 +++++++++++++++++++++++++++++++++++++- ci/bin/build.sh | 8 +++++++ ci/bin/run.sh | 4 ++-- 3 files changed, 57 insertions(+), 3 deletions(-) create mode 100755 ci/bin/build.sh diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c8b5221..dbdd10b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,7 +17,25 @@ jobs: with: access_token: ${{ github.token }} + build-npm: + name: build + runs-on: + - self-hosted + steps: + - uses: actions/checkout@v2 + - shell: bash + name: npm install + run: | + ci/bin/build.sh + - name: upload build + uses: actions/upload-artifact@v2 + with: + name: node-modules + path: node_modules/ + csi-sanity-synology: + needs: + - build-npm strategy: fail-fast: false matrix: @@ -28,6 +46,9 @@ jobs: - csi-sanity-synology steps: - uses: actions/checkout@v2 + - uses: actions/download-artifact@v2 + with: + name: node-modules - name: csi-sanity run: | # run tests @@ -42,6 +63,8 @@ jobs: # api-based drivers csi-sanity-truenas-scale-22_02: + needs: + - build-npm strategy: fail-fast: false matrix: @@ -56,6 +79,9 @@ jobs: #- csi-sanity-truenas-scale steps: - uses: actions/checkout@v2 + - uses: actions/download-artifact@v2 + with: + name: node-modules - name: csi-sanity run: | # run tests @@ -68,6 +94,8 @@ jobs: # ssh-based drivers csi-sanity-truenas-core-12_0: + needs: + - build-npm strategy: fail-fast: false matrix: @@ -83,6 +111,9 @@ jobs: #- csi-sanity-truenas-core steps: - uses: actions/checkout@v2 + - uses: actions/download-artifact@v2 + with: + name: node-modules - name: csi-sanity run: | # run tests @@ -95,6 +126,8 @@ jobs: # ssh-based drivers csi-sanity-truenas-core-13_0: + needs: + - build-npm strategy: fail-fast: false matrix: @@ -109,6 +142,9 @@ jobs: #- csi-sanity-truenas-core steps: - uses: actions/checkout@v2 + - uses: actions/download-artifact@v2 + with: + name: node-modules - name: csi-sanity run: | # run tests @@ -122,6 +158,8 @@ jobs: # ssh-based drivers csi-sanity-zfs-generic: + needs: + - build-npm strategy: fail-fast: false matrix: @@ -133,6 +171,9 @@ jobs: - csi-sanity-zfs-generic steps: - uses: actions/checkout@v2 + - uses: actions/download-artifact@v2 + with: + name: node-modules - name: csi-sanity run: | # run tests @@ -145,6 +186,8 @@ jobs: # zfs-local drivers csi-sanity-zfs-local: + needs: + - build-npm strategy: fail-fast: false matrix: @@ -156,6 +199,9 @@ jobs: - csi-sanity-zfs-local steps: - uses: actions/checkout@v2 + - uses: actions/download-artifact@v2 + with: + name: node-modules - name: csi-sanity run: | # run tests @@ -163,7 +209,7 @@ jobs: env: TEMPLATE_CONFIG_FILE: "./ci/configs/${{ matrix.config }}" - build: + build-docker: needs: - csi-sanity-synology - csi-sanity-truenas-scale-22_02 diff --git a/ci/bin/build.sh b/ci/bin/build.sh new file mode 100755 index 0000000..49ca883 --- /dev/null +++ b/ci/bin/build.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +set -e +set -x + +export PATH="/usr/local/lib/nodejs/bin:${PATH}" +# install deps +npm i diff --git a/ci/bin/run.sh b/ci/bin/run.sh index 9aa0898..1dcda9a 100755 --- a/ci/bin/run.sh +++ b/ci/bin/run.sh @@ -13,7 +13,7 @@ trap _term EXIT export PATH="/usr/local/lib/nodejs/bin:${PATH}" # install deps -npm i +#npm i # generate key for paths etc export CI_BUILD_KEY=$(uuidgen | cut -d "-" -f 1) @@ -28,7 +28,7 @@ SUDO_PID=$! : ${CSI_ENDPOINT:=/tmp/csi-${CI_BUILD_KEY}.sock} iter=0 max_iter=60 -while [ ! -f "${CSI_ENDPOINT}" ];do +while [ ! -S "${CSI_ENDPOINT}" ];do ((++iter)) echo "waiting for ${CSI_ENDPOINT} to appear" sleep 1