-
Notifications
You must be signed in to change notification settings - Fork 13
196 lines (167 loc) · 6.16 KB
/
Copy pathci.yml
File metadata and controls
196 lines (167 loc) · 6.16 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
name: CI
on:
push:
branches:
- "**"
pull_request:
permissions:
contents: read
defaults:
run:
shell: bash
env:
CARGO_TERM_COLOR: always
jobs:
contract:
name: Contract (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo registry and build output
uses: Swatinem/rust-cache@v2
- name: Run contract regression scope
run: |
V8_RUNNER_CI_SCOPE=contract bash scripts/test/ci-rust.sh
happy-path:
name: Happy Path (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
env:
V8TR_CI_TARGET_OS: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Install Python
uses: actions/setup-python@v6
with:
python-version: "3.x"
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo registry and build output
uses: Swatinem/rust-cache@v2
- name: Evaluate trusted live execution mode
id: trust
env:
EVENT_NAME: ${{ github.event_name }}
ACTOR: ${{ github.actor }}
HEAD_REPO: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
REPOSITORY: ${{ github.repository }}
MATRIX_OS: ${{ matrix.os }}
V8TR_PLATFORM_BUNDLE_URL_LINUX: ${{ secrets.V8TR_PLATFORM_BUNDLE_URL_LINUX }}
V8TR_PLATFORM_BUNDLE_SHA256_LINUX: ${{ secrets.V8TR_PLATFORM_BUNDLE_SHA256_LINUX }}
V8TR_PLATFORM_BUNDLE_URL_WINDOWS: ${{ secrets.V8TR_PLATFORM_BUNDLE_URL_WINDOWS }}
V8TR_PLATFORM_BUNDLE_SHA256_WINDOWS: ${{ secrets.V8TR_PLATFORM_BUNDLE_SHA256_WINDOWS }}
run: |
trusted="true"
if [[ "$ACTOR" == "dependabot[bot]" ]]; then
trusted="false"
elif [[ "$EVENT_NAME" == "pull_request" && "$HEAD_REPO" != "$REPOSITORY" ]]; then
trusted="false"
fi
case "$MATRIX_OS" in
ubuntu-latest)
bundle_url="$V8TR_PLATFORM_BUNDLE_URL_LINUX"
bundle_sha256="$V8TR_PLATFORM_BUNDLE_SHA256_LINUX"
;;
windows-latest)
bundle_url="$V8TR_PLATFORM_BUNDLE_URL_WINDOWS"
bundle_sha256="$V8TR_PLATFORM_BUNDLE_SHA256_WINDOWS"
;;
*)
echo "Unsupported matrix.os: $MATRIX_OS" >&2
exit 2
;;
esac
if [[ -z "$bundle_url" || -z "$bundle_sha256" ]]; then
trusted="false"
echo "V8TR_DESIGNER_ALLOW_MISSING_CONFIG=1" >> "$GITHUB_ENV"
fi
echo "trusted=$trusted" >> "$GITHUB_OUTPUT"
if [[ "$trusted" != "true" ]]; then
echo "V8TR_DESIGNER_ALLOW_MISSING_CONFIG=1" >> "$GITHUB_ENV"
fi
- name: Verify bash and python3 contract
run: |
bash --version
python3 --version
- name: Select platform bundle secret for trusted live path
if: steps.trust.outputs.trusted == 'true'
env:
MATRIX_OS: ${{ matrix.os }}
V8TR_PLATFORM_BUNDLE_URL_LINUX: ${{ secrets.V8TR_PLATFORM_BUNDLE_URL_LINUX }}
V8TR_PLATFORM_BUNDLE_SHA256_LINUX: ${{ secrets.V8TR_PLATFORM_BUNDLE_SHA256_LINUX }}
V8TR_PLATFORM_BUNDLE_URL_WINDOWS: ${{ secrets.V8TR_PLATFORM_BUNDLE_URL_WINDOWS }}
V8TR_PLATFORM_BUNDLE_SHA256_WINDOWS: ${{ secrets.V8TR_PLATFORM_BUNDLE_SHA256_WINDOWS }}
run: |
case "$MATRIX_OS" in
ubuntu-latest)
bundle_url="$V8TR_PLATFORM_BUNDLE_URL_LINUX"
bundle_sha256="$V8TR_PLATFORM_BUNDLE_SHA256_LINUX"
;;
windows-latest)
bundle_url="$V8TR_PLATFORM_BUNDLE_URL_WINDOWS"
bundle_sha256="$V8TR_PLATFORM_BUNDLE_SHA256_WINDOWS"
;;
*)
echo "Unsupported matrix.os: $MATRIX_OS" >&2
exit 2
;;
esac
if [[ -z "$bundle_url" ]]; then
echo "Trusted happy-path requires a platform bundle URL secret for $MATRIX_OS" >&2
exit 2
fi
if [[ -z "$bundle_sha256" ]]; then
echo "Trusted happy-path requires a platform bundle SHA256 secret for $MATRIX_OS" >&2
exit 2
fi
{
echo "V8TR_PLATFORM_BUNDLE_URL<<__V8TR_ENV__"
echo "$bundle_url"
echo "__V8TR_ENV__"
echo "V8TR_PLATFORM_BUNDLE_SHA256<<__V8TR_ENV__"
echo "$bundle_sha256"
echo "__V8TR_ENV__"
} >> "$GITHUB_ENV"
- name: Install 1C platform bundle
if: steps.trust.outputs.trusted == 'true'
run: |
bash scripts/test/ci-platform-install.sh
- name: Materialize dedicated Designer config
if: steps.trust.outputs.trusted == 'true'
run: |
bash scripts/test/ci-designer-config.sh
- name: Bootstrap file infobase through ibsrv
if: steps.trust.outputs.trusted == 'true'
run: |
bash scripts/test/ci-ibsrv.sh start
- name: Run happy-path scope
run: |
V8_RUNNER_CI_SCOPE=happy-path bash scripts/test/ci-rust.sh
- name: Stop ibsrv sidecar
if: always() && steps.trust.outputs.trusted == 'true'
run: |
bash scripts/test/ci-ibsrv.sh stop
- name: Upload deploy-ready artifacts
if: success() && steps.trust.outputs.trusted == 'true'
uses: actions/upload-artifact@v7
with:
name: deploy-ready-${{ runner.os }}
path: |
target/manual-tests/live-cli-designer/artifacts/configuration.cf
target/manual-tests/live-cli-designer/artifacts/extension.cfe
target/manual-tests/live-cli-designer/artifacts/external-processor/*.epf
target/manual-tests/live-cli-designer/artifacts/external-report/*.erf
if-no-files-found: error