Skip to content

Commit 11c2781

Browse files
blackheavenfrasertweedale
authored andcommitted
feature(ci): check advisories after nix job
1 parent 7b5cca4 commit 11c2781

File tree

2 files changed

+28
-22
lines changed

2 files changed

+28
-22
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -240,19 +240,3 @@ jobs:
240240
with:
241241
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
242242
path: ~/.cabal/store
243-
- name: install executable
244-
if: matrix.compiler == 'ghc-9.6.2'
245-
run: |
246-
$CABAL v2-install $ARG_COMPILER --install-method=copy exe:hsec-tools
247-
- name: upload executable
248-
uses: actions/upload-artifact@v3
249-
if: matrix.compiler == 'ghc-9.6.2'
250-
with:
251-
name: hsec-tools-${{ github.sha }}
252-
path: ~/.cabal/bin/hsec-tools
253-
check-advisories:
254-
name: Invoke check-advisories workflow
255-
needs: linux
256-
uses: ./.github/workflows/check-advisories.yml
257-
with:
258-
artifact-name: hsec-tools-${{ github.sha }}

.github/workflows/nix.yml

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,34 @@ jobs:
3232
uses: DeterminateSystems/flake-checker-action@v4
3333
with:
3434
flake-lock-path: ./code/hsec-tools/flake.lock
35-
- run: nix -L build
35+
- name: Build executable
36+
run: nix -L build
3637
working-directory: ./code/hsec-tools
37-
- run: mkdir -p ~/.local/bin
38-
- run: cp code/hsec-tools/result/bin/hsec-tools ~/.local/bin
39-
- uses: actions/upload-artifact@v3
38+
- name: Bild docker image
39+
run: nix build -L '.#packages.x86_64-linux.hsec-tools-image'
40+
working-directory: ./code/hsec-tools
41+
- run: mkdir -p ~/.local/dockerImages
42+
- run: cp code/hsec-tools/result ~/.local/dockerImages/hsec-tools
43+
- id: code-hash
44+
name: Compute code directory hash
45+
run: |
46+
code_hash=$(git rev-parse HEAD:code)
47+
echo "code-hash=$code_hash" >> "$GITHUB_OUTPUT"
48+
- uses: actions/cache/save@v3
4049
if: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
4150
with:
42-
name: hsec-tools-main
43-
path: ~/.local/bin
51+
key: hsec-tools-${{ steps.code-hash.outputs.code-hash}}
52+
path: ~/.local/dockerImages
53+
- name: upload executable
54+
uses: actions/upload-artifact@v3
55+
with:
56+
name: hsec-tools-${{ github.sha }}
57+
path: ~/.local/dockerImages
58+
check-advisories:
59+
name: Invoke check-advisories workflow
60+
if: ${{ needs.tools_changed.outputs.should_skip != 'true' }}
61+
needs: check_nix
62+
uses: ./.github/workflows/check-advisories.yml
63+
with:
64+
fetch-key: hsec-tools-${{ github.sha }}
65+
is-artifact: true

0 commit comments

Comments
 (0)