Repository navigation
127 lines (127 loc) · 4.14 KB
/
Copy pathci.yml
File metadata and controls
127 lines (127 loc) · 4.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
name: Model-free CI
on:
pull_request:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check:
name: ${{ matrix.name }}
strategy:
fail-fast: false
matrix:
include:
- name: Lint
command: lint
- name: Type check
command: typecheck
- name: Unit tests
command: test:coverage
- name: Bundle verification
command: check:package
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: .node-version
- run: corepack enable
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
store_path="$(corepack pnpm store path --silent)"
delim="EOF_$(od -An -N8 -tx1 /dev/urandom | tr -d ' \n')"
{
printf 'STORE_PATH<<%s\n' "$delim"
printf '%s\n' "$store_path"
printf '%s\n' "$delim"
} >> "$GITHUB_OUTPUT"
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- run: corepack pnpm install --frozen-lockfile --ignore-scripts
- run: corepack pnpm "${{ matrix.command }}"
- run: git diff --exit-code
packaged:
name: Action smoke test
runs-on: ubuntu-latest
timeout-minutes: 5
env:
VALLY_TELEMETRY_OPTOUT: '1'
DO_NOT_TRACK: '1'
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- name: Run native mock evaluation through the packaged Action
id: passing
uses: ./
continue-on-error: true
with:
command: run
working-directory: .
eval-paths: tests/fixtures/pass.eval.yaml
vally-version: 0.21.0
report-id: native-pass
- name: Verify native verdict failure through the same installed CLI
id: failing
uses: ./
continue-on-error: true
with:
command: run
working-directory: .
eval-paths: tests/fixtures/fail.eval.yaml
vally-version: 0.21.0
report-id: native-fail
- name: Lint through the same installed CLI
id: lint
uses: ./
continue-on-error: true
with:
command: lint
working-directory: tests/fixtures
vally-version: 0.21.0
report-id: native-lint
- name: Check native results and structured uploads
env:
PASS_OUTCOME: ${{ steps.passing.outputs.outcome }}
PASS_STEP: ${{ steps.passing.outcome }}
FAIL_OUTCOME: ${{ steps.failing.outputs.outcome }}
FAIL_STEP: ${{ steps.failing.outcome }}
LINT_OUTCOME: ${{ steps.lint.outputs.outcome }}
LINT_STEP: ${{ steps.lint.outcome }}
PASS_ARTIFACT: ${{ steps.passing.outputs.artifact-id }}
FAIL_ARTIFACT: ${{ steps.failing.outputs.artifact-id }}
LINT_ARTIFACT: ${{ steps.lint.outputs.artifact-id }}
EXECUTED: ${{ steps.passing.outputs.executed }}
FAILED: ${{ steps.failing.outputs.failed }}
run: |
test -n "$PASS_ARTIFACT"
test -n "$FAIL_ARTIFACT"
test -n "$LINT_ARTIFACT"
if [ "$PASS_OUTCOME" = not-run ]; then
test "$PASS_STEP" = success
test "$FAIL_OUTCOME" = not-run
test "$LINT_OUTCOME" = not-run
else
test "$PASS_OUTCOME" = passed
test "$PASS_STEP" = success
test "$EXECUTED" = 1
test "$FAIL_OUTCOME" = failed
test "$FAIL_STEP" = failure
test "$FAILED" = 1
test "$LINT_OUTCOME" = validated
test "$LINT_STEP" = success
fi