-
Notifications
You must be signed in to change notification settings - Fork 15
139 lines (122 loc) · 4.38 KB
/
slang-tests.yaml
File metadata and controls
139 lines (122 loc) · 4.38 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
name: Slang Tests
on:
pull_request:
types: [opened, synchronize, reopened, labeled]
merge_group:
permissions:
contents: read
checks: write
packages: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
label-check:
if: >-
(github.event.action == 'labeled' && github.event.label.name == 'ci:slang'
|| github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:slang'))
&& !github.event.pull_request.head.repo.fork
runs-on: ubuntu-24.04
steps:
- run: 'true'
cooldown-check:
name: Cargo cooldown check
runs-on: ubuntu-24.04
needs: label-check
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: ./.github/actions/cooldown-check
slang-tests:
needs: [label-check, cooldown-check]
env:
CARGO_TARGET_DIR: target-slang
CARGO_INCREMENTAL: "0"
strategy:
fail-fast: false
matrix:
include:
- name: "MacOS x86"
runner: macos-15-intel
- name: "MacOS arm64"
runner: macos-15
- name: "Linux x86 gnu"
runner: ubuntu-24.04
image: ghcr.io/nomicfoundation/solx-ci-runner@sha256:c2b03000a1074d2cc3e6cf25a1c4fdc6eb0a61d23e63bef59205050249fa1d6e
target: "x86_64-unknown-linux-gnu"
- name: "Linux ARM64 gnu"
runner: ubuntu-24.04-arm
image: ghcr.io/nomicfoundation/solx-ci-runner@sha256:c2b03000a1074d2cc3e6cf25a1c4fdc6eb0a61d23e63bef59205050249fa1d6e
target: "aarch64-unknown-linux-gnu"
- name: "Windows"
runner: windows-2025
target: "x86_64-pc-windows-gnu"
runs-on: ${{ matrix.runner }}
container:
image: ${{ matrix.image || '' }}
name: ${{ matrix.name }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: true
# This step is required to checkout submodules
# that are disabled in .gitmodules config
- name: Checkout submodules
run: |
git config --global --add safe.directory '*'
git submodule update --force --depth=1 --recursive --checkout
- name: Setup SFW
uses: ./.github/actions/setup-sfw
- name: Prepare Windows env
if: runner.os == 'Windows'
uses: ./.github/actions/prepare-msys
- name: Build LLVM
uses: ./.github/actions/build-llvm
with:
build-type: RelWithDebInfo
enable-assertions: 'true'
enable-mlir: 'true'
# bindgen's embedded clang needs to know it's targeting MinGW,
# otherwise it can't parse MinGW-specific __attribute__ extensions
# in stdlib.h (rust-lang/rust-bindgen#1760).
- name: Set bindgen target for MinGW
if: runner.os == 'Windows'
shell: bash
run: echo "BINDGEN_EXTRA_CLANG_ARGS=--target=x86_64-w64-windows-gnu" >> "${GITHUB_ENV}"
- name: Free disk space (remove build artifacts before slang tests)
shell: bash
run: |
echo "Before cleanup:" && df -h .
rm -rf solx-llvm target-llvm/build-final target solx-solidity
echo "After cleanup:" && df -h .
- name: Cache cargo artifacts
if: ${{ !matrix.image }}
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
with:
prefix-key: slang-tests-v2
cache-on-failure: true
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Run slang tests
uses: ./.github/actions/rust-unit-tests
with:
target: ${{ matrix.target || '' }}
cargo-test-command: 'test-slang'
results-xml: 'slang-unit-tests-results.xml'
check-name: 'Slang Unit Tests Results'
pr-checks:
name: PR Checks (Slang)
runs-on: ubuntu-24.04
if: always()
needs:
- label-check
- cooldown-check
- slang-tests
steps:
- name: Decide on PR checks
uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # release/v1
with:
jobs: ${{ toJSON(needs) }}
allowed-skips: >-
${{ needs.label-check.result == 'skipped' && 'label-check, cooldown-check, slang-tests' || '' }}