Skip to content

feat(slang): checked arithmetic, narrow types, and MLIR alignment #1986

feat(slang): checked arithmetic, narrow types, and MLIR alignment

feat(slang): checked arithmetic, narrow types, and MLIR alignment #1986

Workflow file for this run

name: Tests
# Execute workflow for each PR and with each merge to the trunk
on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches:
- main
permissions:
contents: read
packages: read
# Cancel the workflow if any new changes pushed to a feature branch or the trunk
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
# Detect whether code (non-doc) files changed
changes:
runs-on: ubuntu-24.04
permissions:
contents: read
pull-requests: read
outputs:
code: ${{ steps.filter.outputs.code }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
id: filter
with:
predicate-quantifier: 'every'
filters: |
code:
- '**'
- '!docs/**'
- '!**/*.md'
- '!**/*.mdx'
- '!**/LICENSE*'
# Check for cargo issues
cargo-checks:
needs: changes
if: needs.changes.outputs.code == 'true'
runs-on: ubuntu-24.04
container:
image: ghcr.io/nomicfoundation/solx-ci-runner@sha256:c0866d146261cd0a51dc7d9077444b8ac3dde12c53d2151137834e6be149dbc7
steps:
- name: Checkout source
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: Build LLVM
uses: ./.github/actions/build-llvm
with:
build-type: RelWithDebInfo
enable-assertions: 'true'
enable-mlir: 'true'
- name: Cargo checks
uses: ./.github/actions/cargo-check
cooldown-check:
name: Cargo cooldown check
runs-on: ubuntu-24.04
needs: changes
if: needs.changes.outputs.code == 'true'
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: ./.github/actions/cooldown-check
# Build and run regression tests
build-and-test:
needs: changes
if: needs.changes.outputs.code == 'true'
env:
CARGO_INCREMENTAL: "0"
permissions:
contents: read
checks: write
packages: read
strategy:
fail-fast: false # finalize testing of all targets even if one failed
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:c0866d146261cd0a51dc7d9077444b8ac3dde12c53d2151137834e6be149dbc7
target: "x86_64-unknown-linux-gnu"
- name: "Linux ARM64 gnu"
runner: ubuntu-24.04-arm
image: ghcr.io/nomicfoundation/solx-ci-runner@sha256:c0866d146261cd0a51dc7d9077444b8ac3dde12c53d2151137834e6be149dbc7
target: "aarch64-unknown-linux-gnu"
- name: "Windows"
runner: windows-2025
target: "x86_64-pc-windows-gnu"
runs-on: ${{ matrix.runner }}
container:
image: ${{ matrix.image || '' }} # Special workaround to allow matrix builds with optional container
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: Prepare Windows env
if: runner.os == 'Windows'
uses: ./.github/actions/prepare-msys
- name: Cache cargo artifacts
if: ${{ !matrix.image }}
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
with:
prefix-key: build-and-test-v2
cache-on-failure: true
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Build LLVM
uses: ./.github/actions/build-llvm
with:
build-type: RelWithDebInfo
enable-assertions: 'true'
enable-mlir: 'true'
- name: Building solc
uses: ./.github/actions/build-solc
with:
cmake-build-type: RelWithDebInfo
working-dir: 'solx-solidity'
- name: Free disk space (remove LLVM source and build artifacts)
shell: bash
run: |
echo "Before cleanup:" && df -h .
rm -rf solx-llvm target-llvm/build-final
echo "After cleanup:" && df -h .
- name: Run tests
uses: ./.github/actions/rust-unit-tests
env:
BOOST_PREFIX: ${{ github.workspace }}/solx-solidity/boost/lib
SOLC_PREFIX: ${{ github.workspace }}/solx-solidity/build
with:
target: ${{ matrix.target || '' }}
# Special job that allows some of the jobs to be skipped or failed
# requiring others to be successful
pr-checks:
name: PR Checks (Tests)
runs-on: ubuntu-24.04
if: always()
needs:
- changes
- cargo-checks
- build-and-test
- cooldown-check
steps:
- name: Decide on PR checks
uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # release/v1
with:
jobs: ${{ toJSON(needs) }}
allowed-skips: >-
${{ needs.changes.outputs.code != 'true' && 'cargo-checks, build-and-test, cooldown-check' || '' }}