|
| 1 | +name: Reusable build action on windows |
| 2 | +on: |
| 3 | + workflow_call: |
| 4 | + inputs: |
| 5 | + name: |
| 6 | + type: string |
| 7 | + default: cpu |
| 8 | + options: |
| 9 | + type: string |
| 10 | + default: |
| 11 | + cuda_compiler_version: |
| 12 | + type: string |
| 13 | + |
| 14 | + |
| 15 | + outputs: |
| 16 | + cache-suffix: |
| 17 | + value: ${{ jobs.build.outputs.cache-suffix }} |
| 18 | + |
| 19 | +jobs: |
| 20 | + build: |
| 21 | + name: Conda - ${{ inputs.name }} |
| 22 | + runs-on: windows-latest |
| 23 | + |
| 24 | + outputs: |
| 25 | + cache-suffix: ${{ env.DATE }} |
| 26 | + |
| 27 | + steps: |
| 28 | + - uses: actions/checkout@v3 |
| 29 | + |
| 30 | + - name: Set env context |
| 31 | + run: | |
| 32 | + echo RUN_STAMP=${{ runner.os }}-${{ inputs.name }} >> $env:GITHUB_ENV |
| 33 | + echo CONDA_ENV_PATH=$env:CONDA/envs/omnisci-dev >> $env:GITHUB_ENV |
| 34 | + echo "DATE=$(date +'%Y%m%d')" >> $env:GITHUB_ENV |
| 35 | + echo TMP=$env:TMP >> $env:GITHUB_ENV |
| 36 | +
|
| 37 | + - name: Get env |
| 38 | + run: | |
| 39 | + Get-ChildItem env: |
| 40 | +
|
| 41 | + - name: Get disk space |
| 42 | + run: | |
| 43 | + Get-PSDrive |
| 44 | +
|
| 45 | + - name: Restore Conda env cache |
| 46 | + id: conda-cache |
| 47 | + uses: actions/cache@v3 |
| 48 | + with: |
| 49 | + path: | |
| 50 | + ${{ env.CONDA_ENV_PATH }} |
| 51 | + key: ${{ env.RUN_STAMP }}-conda-${{ hashFiles('omniscidb/scripts/mapd-deps-conda-windows-env.yml') }}-${{ env.DATE }} |
| 52 | + restore-keys: | |
| 53 | + ${{ env.RUN_STAMP }}-conda-${{ hashFiles('omniscidb/scripts/mapd-deps-conda-windows-env.yml') }}- |
| 54 | +
|
| 55 | + - name: Update Conda env |
| 56 | + if: steps.conda-cache.cache-hit != 'true' |
| 57 | + run: | |
| 58 | + & $env:CONDA\condabin\conda.bat update conda |
| 59 | + & $env:CONDA\condabin\conda.bat env update -f omniscidb/scripts/mapd-deps-conda-windows-env.yml |
| 60 | +
|
| 61 | + - name: Restore Maven cache |
| 62 | + uses: actions/cache@v3 |
| 63 | + with: |
| 64 | + path: | |
| 65 | + ~/.m2 |
| 66 | + key: maven-${{ hashFiles('**/pom.xml') }} |
| 67 | + restore-keys: maven- |
| 68 | + |
| 69 | + - name: Conda - ${{ inputs.name }} |
| 70 | + run: | |
| 71 | + & $env:CONDA\condabin\conda.bat info |
| 72 | + & $env:CONDA\condabin\conda.bat list -n omnisci-dev |
| 73 | + & $env:CONDA\condabin\conda.bat run --no-capture-output -n omnisci-dev omniscidb\scripts\conda\build.bat ${{ inputs.options }} |
| 74 | + Compress-Archive -Path . -DestinationPath $env:TMP\build.zip |
| 75 | +
|
| 76 | + - name: Upload build and src files |
| 77 | + uses: actions/upload-artifact@v3 |
| 78 | + with: |
| 79 | + name: ${{ env.RUN_STAMP }}-build |
| 80 | + path: ${{ env.TMP }}/build.zip |
| 81 | + |
| 82 | + - name: Upload logs |
| 83 | + if: always() |
| 84 | + uses: actions/upload-artifact@v3 |
| 85 | + with: |
| 86 | + name: ${{ env.RUN_STAMP }}-logs |
| 87 | + path: | |
| 88 | + build/*.log |
| 89 | + build/CMakeCache.txt |
| 90 | + build/CMakeFiles/*.log |
| 91 | +
|
0 commit comments