From 308df35316d0f09d46b80686c74ddb63d823ed22 Mon Sep 17 00:00:00 2001 From: James Price Date: Sat, 16 Oct 2021 11:10:05 -0400 Subject: [PATCH] Upload Linux and macOS binaries via GitHub Actions --- .github/workflows/ci.yml | 35 +++++++++++++++++++++--------- .github/workflows/run-cts-suite.sh | 2 +- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 12357fb4..2fe34560 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,6 +24,7 @@ jobs: needs: [check-format] env: LLVM_VERSION: ${{ matrix.llvm }} + INSTALL_DIR: "${{ github.workspace }}/install" strategy: matrix: os: [ubuntu-20.04, macos-11.0] @@ -60,15 +61,10 @@ jobs: fi - name: Create build dir run: cmake -E make_directory build - - name: cache-oclgrind - uses: actions/cache@v2 - with: - path: install - key: oclgrind-${{ matrix.os }}-llvm-${{ matrix.llvm }}-${{ matrix.compiler }}-${{ matrix.build_type }}-${{github.sha}} - name: CMake run: > cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ - -DCMAKE_INSTALL_PREFIX=$PWD/../install \ + -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} \ -DLLVM_DIR="$LLVM_DIR" working-directory: build - name: Build @@ -80,6 +76,22 @@ jobs: - name: Install run: cmake --install . --config ${{ matrix.build_type }} working-directory: build + - name: Prepare build artifact + shell: bash + run: | + if [[ "${{ matrix.os }}" =~ ubuntu-.* ]]; then + cp src/install/INSTALL.linux ${INSTALL_DIR} + elif [[ "${{ matrix.os }}" =~ macos-.* ]]; then + cp src/install/INSTALL.darwin ${INSTALL_DIR} + fi + mv ${INSTALL_DIR} oclgrind-${RELEASE_VERSION} + mkdir -p artifact + tar czf artifact/oclgrind-${RELEASE_VERSION}.tgz oclgrind-${RELEASE_VERSION} + - name: Upload build artifact + uses: actions/upload-artifact@v2 + with: + name: Oclgrind-${{ env.RELEASE_VERSION }}-${{ matrix.os }}-llvm${{ matrix.llvm }}-${{ matrix.build_type }}-${{ matrix.compiler }} + path: artifact build-windows: name: Build ${{ matrix.platform }} llvm-${{ matrix.llvm }} @@ -277,11 +289,14 @@ jobs: - uses: actions/checkout@v2 - name: Install dependencies run: bash .github/workflows/install-deps.sh - - name: cache-oclgrind - uses: actions/cache@v2 + - name: Download Oclgrind + uses: actions/download-artifact@v2 with: - path: install - key: oclgrind-ubuntu-20.04-llvm-13-gcc-Release-${{github.sha}} + name: Oclgrind-${{ env.RELEASE_VERSION }}-ubuntu-20.04-llvm${{ env.RELEASE_LLVM }}-Release-gcc + - name: Unpack Oclgrind + shell: bash + run: | + tar xf oclgrind-${RELEASE_VERSION}.tgz - name: cache-cts uses: actions/cache@v2 with: diff --git a/.github/workflows/run-cts-suite.sh b/.github/workflows/run-cts-suite.sh index 0a3d60f6..5c77eb97 100755 --- a/.github/workflows/run-cts-suite.sh +++ b/.github/workflows/run-cts-suite.sh @@ -35,7 +35,7 @@ fi retcode=0 -export PATH=$PWD/install/bin:$PATH +export PATH=$PWD/oclgrind-${RELEASE_VERSION}/bin:$PATH export CL_CONFORMANCE_RESULTS_FILENAME=$PWD/result.json echo oclgrind opencl-cts/build/test_conformance/${ctsdir}/${ctsbin} ${ctsargs} oclgrind opencl-cts/build/test_conformance/${ctsdir}/${ctsbin} ${ctsargs}