Skip to content

Commit 44168e3

Browse files
authored
Merge pull request #21 from SURFnet/improve-workflows
Use jomco/clojure-action and make NVD dependency check more reliable
2 parents 5e34ebf + 7db4d9f commit 44168e3

4 files changed

Lines changed: 12 additions & 55 deletions

File tree

.github/workflows/build.yml

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,14 @@ jobs:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- uses: actions/checkout@v4
15-
- uses: actions/cache@v4
16-
with: { path: "~/.m2", key: "${{ runner.os }}-${{ hashFiles('deps.edn') }}-m2" }
17-
- uses: actions/cache@v4
18-
with:
19-
key: "clojure-${{ runner.os }}-${{ hashFiles('.github/workflows/install-binaries.sh') }}"
20-
path: |
21-
~/bin
22-
~/lib
14+
- uses: actions/checkout@v7
15+
- uses: jomco/clojure-action@v0
16+
with: { m2-cache-key: m2-build-checks }
2317

2418
- name: Install packages
2519
run: |
2620
sudo apt-get install -y reuse
2721
28-
- name: Install clj runtime
29-
run: .github/workflows/install-binaries.sh
30-
3122
- name: Run release checks
3223
run: make release_check
3324

@@ -78,23 +69,13 @@ jobs:
7869
- standalone.jar
7970

8071
steps:
81-
- uses: actions/checkout@v4
82-
- uses: actions/cache@v4
83-
with: { path: "~/.m2", key: "${{ runner.os }}-${{ hashFiles('deps.edn') }}-m2" }
84-
- uses: actions/cache@v4
85-
with:
86-
key: "clojure-${{ runner.os }}-${{ hashFiles('.github/workflows/install-binaries.sh') }}"
87-
path: |
88-
~/bin
89-
~/lib
72+
- uses: jomco/clojure-action@v0
73+
with: { m2-cache-key: m2-build-artifacts }
9074

9175
- name: Artifact name
9276
run: echo filename=eduhub-validator-${{ needs.create_release.outputs.version }}-${{ matrix.arch }} >> $GITHUB_OUTPUT
9377
id: artifact
94-
95-
- name: Install clj runtime
96-
run: .github/workflows/install-binaries.sh
97-
78+
9879
- name: Build artifact
9980
run: make ${{ steps.artifact.outputs.filename }}
10081

.github/workflows/dependency-vulnerabilities.yml

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -14,34 +14,9 @@ jobs:
1414
runs-on: ubuntu-latest
1515

1616
steps:
17-
18-
# NVD data can change every day, so we use a cache key based on today's date
19-
- name: Get current date
20-
id: date
21-
run: echo "date=$(date '+%Y-%m-%d')" >> $GITHUB_OUTPUT
22-
23-
- uses: actions/checkout@v4
24-
- uses: actions/cache@v4
25-
with:
26-
path: "~/.m2"
27-
28-
# store as today's cache
29-
key: "nvd-clojure-${{ steps.date.outputs.date }}"
30-
# if today's cache does not yet exist, fetch from whatever iss
31-
# the most recent cache for nvd-clojure
32-
# and update that
33-
restore-keys: "nvd-clojure-"
34-
35-
- name: Install clj runtime
36-
run: .github/workflows/install-binaries.sh
37-
38-
- name: Check that NVD Secret is set
39-
env:
40-
NVD_API_TOKEN: ${{ secrets.NVD_API_TOKEN }}
41-
if: ${{ env.NVD_API_TOKEN == '' }}
42-
run: echo "NVD_API_TOKEN secret is empty"; exit 1
17+
- uses: actions/checkout@v7
18+
- uses: jomco/clojure-action@v0
19+
with: { m2-cache-key: m2-nvd }
4320

4421
- name: Check clojure dependencies with NVD
45-
env:
46-
CLJ_WATSON_NVD_API_KEY: "${{ secrets.NVD_API_TOKEN }}"
4722
run: make watson

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ generated/resources/extra.css: $(sds_green_css_files)
108108
mkdir -p generated/resources
109109
cat $(sds_green_css_files) > $@
110110

111+
export CLJ_WATSON_NVD_API_KEY=dummy # note: required but not used
112+
export CLJ_WATSON_NVD_API_DATAFEED_URL=https://dependency-check.github.io/DependencyCheck_Builder/nvd_cache/nvdcve-{0}.json.gz
113+
111114
watson:
112115
clojure -M:watson scan -p deps.edn -f -s -w .watson.properties
113116

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,6 @@ directory and are built into the binary releases:
112112
- `ooapi` -- the full OOAPI v5 specification
113113
- `rio` -- the RIO profile of OOAPI v5.
114114
- `eduxchange` -- the eduxchange profile of OOAPI v5.
115-
- `ooapi-v6` -- the full OOAPI v6 specification
116-
- `rio-v6` -- the RIO profile of OOAPI v6
117115

118116
# Extending the validator
119117

0 commit comments

Comments
 (0)