diff --git a/.github/workflows/build_container.yaml b/.github/workflows/build_container.yaml index d9435d4a..39359f1b 100644 --- a/.github/workflows/build_container.yaml +++ b/.github/workflows/build_container.yaml @@ -6,7 +6,7 @@ name: Build docker image # Follows https://github.com/lsst-sqre/build-and-push-to-ghcr jobs: - build: + build_container: runs-on: ubuntu-latest # See https://lsstc.slack.com/archives/C2JP8GGVC/p1698782669757349?thread_ts=1698779230.846079&cid=C2JP8GGVC permissions: @@ -25,7 +25,7 @@ jobs: channel-priority: strict show-channel-urls: true - - name: configure conda and install requirements + - name: Configure conda and install requirements id: rs-install shell: bash -l {0} run: | @@ -52,7 +52,7 @@ jobs: export RUBIN_SIM_DATA_DIR=~/rubin_sim_data scheduler_download_data --update --tdqm_disable - - name: report environment + - name: Report environment shell: bash -l {0} run: | echo pwd is `pwd` @@ -69,7 +69,12 @@ jobs: cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache - - run: echo Pushed ghcr.io/${{ github.repository }}:${{ steps.build.outputs.tag }} + - name: Report build outputs + shell: bash -l {0} + run: | + echo Pushed ghcr.io/${{ github.repository }}:${{ steps.build.outputs.tag }} + echo Fully qualified image digest: ${{ steps.build.outputs.fully_qualified_image_digest }} + echo Tag of the image: ${{ steps.build.outputs.tag }} diff --git a/.github/workflows/build_docs.yaml b/.github/workflows/build_docs.yaml index 36ddb500..db293088 100644 --- a/.github/workflows/build_docs.yaml +++ b/.github/workflows/build_docs.yaml @@ -23,7 +23,7 @@ jobs: channel-priority: strict show-channel-urls: true - - name: configure and install requirements and documenteer + - name: Configure and install requirements and documenteer shell: bash -l {0} run: | conda config --set always_yes yes @@ -31,24 +31,24 @@ jobs: conda install --quiet pip pip install "documenteer[guide]" - - name: install schedview + - name: Install schedview shell: bash -l {0} run: | echo `pwd` python -m pip install . - - name: check conda and documenteer + - name: Check conda and documenteer shell: bash -l {0} run: | conda list - - name: build docs + - name: Build docs shell: bash -l {0} run: | cd docs package-docs build - - name: upload documentation + - name: Upload documentation uses: lsst-sqre/ltd-upload@v1 with: project: "schedview" diff --git a/.github/workflows/cleanup_cache.yaml b/.github/workflows/cleanup_cache.yaml new file mode 100644 index 00000000..bafab8db --- /dev/null +++ b/.github/workflows/cleanup_cache.yaml @@ -0,0 +1,32 @@ +name: Auto cleanup cache for branch +on: + pull_request: + types: + - closed + +jobs: + cleanup-cache: + runs-on: ubuntu-latest + steps: + - name: Cleanup + run: | + gh extension install actions/gh-actions-cache + + echo "Fetching list of cache key" + cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH | cut -f 1) + + ## Setting this to not fail the workflow while deleting cache keys. + set +e + echo "Deleting caches..." + for cacheKey in $cacheKeysForPR + do + gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm + done + echo "Done" + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + REPO: ${{ github.repository }} + BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge + + + diff --git a/.github/workflows/test_and_build.yaml b/.github/workflows/test_and_build.yaml index 436a0ce0..1b4d495f 100644 --- a/.github/workflows/test_and_build.yaml +++ b/.github/workflows/test_and_build.yaml @@ -36,7 +36,7 @@ jobs: channel-priority: strict show-channel-urls: true - - name: configure conda and install requirements + - name: Configure conda and install requirements id: rs-install shell: bash -l {0} run: | @@ -63,17 +63,17 @@ jobs: export RUBIN_SIM_DATA_DIR=~/rubin_sim_data scheduler_download_data --update --tdqm_disable - - name: install schedview + - name: Install schedview shell: bash -l {0} run: | echo `pwd` python -m pip install . --no-deps - - name: conda list + - name: Conda list shell: bash -l {0} run: conda list - - name: run unit tests + - name: Run unit tests shell: bash -l {0} run: | export RUBIN_SIM_DATA_DIR=~/rubin_sim_data