9
9
env :
10
10
CARGO_TERM_COLOR : always
11
11
TEST_IMAGE_NAME : " orchestr8-tests:0"
12
+ LINT_IMAGE_NAME : " orchestr8-lint:0"
12
13
13
14
jobs :
14
15
build :
17
18
packages : write
18
19
contents : read
19
20
env :
20
- CACHE_IMAGE : " ghcr.io/foundation-model-stack/fms-guardrails-orchestrator:test-cache"
21
+ CACHE_TEST_IMAGE : " ghcr.io/foundation-model-stack/fms-guardrails-orchestrator:test-cache"
22
+ CACHE_LINT_IMAGE : " ghcr.io/foundation-model-stack/fms-guardrails-orchestrator:lint-cache"
21
23
CACHE_REGISTRY : " ghcr.io"
22
24
23
25
steps :
@@ -46,23 +48,34 @@ jobs:
46
48
if [ "${{ github.event_name }}" == "pull_request" ]
47
49
then
48
50
#CACHE_TO="type=gha,mode=min"
49
- CACHE_TO="type=inline"
51
+ CACHE_TEST_TO="type=inline"
52
+ CACHE_LINT_TO="type=inline"
50
53
else
51
- CACHE_TO="type=registry,ref=${{ env.CACHE_IMAGE }},mode=max"
54
+ CACHE_TEST_TO="type=registry,ref=${{ env.CACHE_TEST_IMAGE }},mode=max"
55
+ CACHE_LINT_TO="type=registry,ref=${{ env.CACHE_LINT_IMAGE }},mode=max"
52
56
fi
53
- echo "CACHE_TO=$CACHE_TO" >> $GITHUB_ENV
57
+ echo "CACHE_TEST_TO=$CACHE_TEST_TO" >> $GITHUB_ENV
58
+ echo "CACHE_LINT_TO=$CACHE_LINT_TO" >> $GITHUB_ENV
59
+ - name : Check formatting
60
+ run : cargo fmt -- -check
54
61
- name : Test
55
62
uses : docker/build-push-action@v5
56
63
with :
57
64
context : .
58
65
target : tests
59
66
tags : ${{ env.TEST_IMAGE_NAME }}
60
- cache-from : type=registry,ref=${{ env.CACHE_IMAGE }}
61
- cache-to : ${{ env.CACHE_TO }}
67
+ cache-from : type=registry,ref=${{ env.CACHE_TEST_IMAGE }}
68
+ cache-to : ${{ env.CACHE_TEST_TO }}
62
69
push : false
63
70
platforms : linux/amd64
64
71
- name : Lint with clippy
65
- run : cargo clippy --all-targets --all-features -- -D warnings
66
- - name : Check formatting
67
- run : cargo fmt -- -check
72
+ uses : docker/build-push-action@v5
73
+ with :
74
+ context : .
75
+ target : lint
76
+ tags : ${{ env.LINT_IMAGE_NAME }}
77
+ cache-from : type=registry,ref=${{ env.CACHE_LINT_IMAGE }}
78
+ cache-to : ${{ env.CACHE_LINT_TO }}
79
+ push : false
80
+ platforms : linux/amd64
68
81
0 commit comments