Skip to content

Commit

Permalink
JSON Validity Check and Full Commit History for Deployment Number (#42)
Browse files Browse the repository at this point in the history
* ci.yml: Now always checks if things in versions.json are valid, and fetch all history for commits on branch

* ci/yml: Modified versions output to be referenced correctly

* ci.yml: Added comments on why we checkout the repositories but don't do anything with them
  • Loading branch information
CodeGat authored Feb 7, 2024
1 parent e9364ca commit 8755808
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ jobs:
outputs:
spack-yaml-changed: ${{ steps.filter.outputs.spack-yaml }}
json-changed: ${{ steps.filter.outputs.json }}
versions-json-changed: ${{ steps.filter.outputs.versions-json }}
steps:
- uses: dorny/paths-filter@ad1ae68cd06927a8731fe67e877a2351c7a09691 #v2.9.3
id: filter
Expand All @@ -41,8 +40,6 @@ jobs:
- 'spack.yaml'
json:
- 'config/*.json'
versions-json:
- 'config/versions.json'
spack-yaml-checks:
name: Check spack.yaml
Expand Down Expand Up @@ -95,7 +92,6 @@ jobs:
runs-on: ubuntu-latest
needs:
- changed
if: ${{ needs.changed.outputs.versions-json-changed == 'true' }}
permissions:
pull-requests: write
steps:
Expand All @@ -107,6 +103,8 @@ jobs:
echo "packages=$(jq --compact-output --raw-output '."spack-packages"' ./config/versions.json)" >> $GITHUB_OUTPUT
echo "config=$(jq --compact-output --raw-output '."spack-config"' ./config/versions.json)" >> $GITHUB_OUTPUT
# The next two steps checkout the spack-{packages,config} repos to confirm that the versions in
# versions.json exist in the repositories.
- name: Spack Packages
uses: actions/checkout@v4
with:
Expand All @@ -127,8 +125,8 @@ jobs:
GH_REPO: ${{ github.repository }}
BODY: |
This ${{ github.repository }} model will be deployed using:
* `access-nri/spack-packages` version [`${{ steps.versions.outputs.packages-version }}`](https://github.com/ACCESS-NRI/spack-packages/releases/tag/${{ steps.versions.outputs.packages-version }})
* `access-nri/spack-config` version [`${{ steps.versions.outputs.config-version }}`](https://github.com/ACCESS-NRI/spack-config/releases/tag/${{ steps.versions.outputs.config-version }})
* `access-nri/spack-packages` version [`${{ steps.versions.outputs.packages }}`](https://github.com/ACCESS-NRI/spack-packages/releases/tag/${{ steps.versions.outputs.packages }})
* `access-nri/spack-config` version [`${{ steps.versions.outputs.config }}`](https://github.com/ACCESS-NRI/spack-config/releases/tag/${{ steps.versions.outputs.config }})
If this is not what was expected, commit changes to `config/versions.json`.
run: gh pr comment --body '${{ env.BODY }}'
Expand All @@ -144,6 +142,7 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
fetch-depth: 0

- name: Get Number of Commits on ${{ github.head_ref }}
id: history
Expand Down

0 comments on commit 8755808

Please sign in to comment.