mirror of
https://github.com/realm/SwiftLint.git
synced 2026-05-07 20:12:49 +00:00
97 lines
3.3 KiB
YAML
97 lines
3.3 KiB
YAML
name: Test
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
env:
|
|
SKIP_INTEGRATION_TESTS: 'true'
|
|
|
|
jobs:
|
|
spm_linux:
|
|
name: SPM, Linux, Swift 6.2
|
|
runs-on: ubuntu-24.04
|
|
container: swift:6.2-noble
|
|
steps:
|
|
- &checkout-step
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
- name: Get Swift version
|
|
id: swift_version
|
|
run: echo "version=$(swift --version | grep '[5-9]\.[0-9]\+\(\.[0-9]\)\?' -o | head -1)" >> "$GITHUB_OUTPUT"
|
|
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
|
|
with:
|
|
key: ubuntu-24.04-spm-${{ steps.swift_version.outputs.version }}-${{ hashFiles('Package.resolved', 'Package.swift') }}
|
|
restore-keys: ubuntu-24.04-spm-${{ steps.swift_version.outputs.version }}-
|
|
path: .build
|
|
- name: Run tests
|
|
uses: ./.github/actions/run-make
|
|
with:
|
|
rule: spm_test
|
|
|
|
spm_macos:
|
|
name: SPM, macOS ${{ matrix.macOS }}, Xcode ${{ matrix.xcode }}
|
|
runs-on: macos-${{ matrix.macOS }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- macOS: '14'
|
|
xcode: '16.2'
|
|
- macOS: '15'
|
|
xcode: '16.4'
|
|
- macOS: '26'
|
|
xcode: '26.4'
|
|
env:
|
|
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app
|
|
steps:
|
|
- *checkout-step
|
|
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
|
|
with:
|
|
key: macos-${{ matrix.macOS }}-xcode-spm-${{ matrix.xcode }}-${{ hashFiles('Package.resolved', 'Package.swift') }}
|
|
restore-keys: macos-${{ matrix.macOS }}-xcode-spm-${{ matrix.xcode }}-
|
|
path: .build
|
|
- name: Run tests
|
|
run: make spm_test
|
|
|
|
spm_windows:
|
|
name: SPM, Windows ${{ matrix.windows-display-name }}
|
|
runs-on: windows-${{ matrix.windows-version }}
|
|
env:
|
|
SWIFT_VERSION: development
|
|
SWIFT_BUILD: DEVELOPMENT-SNAPSHOT-2026-03-16-a
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- windows-version: 2025
|
|
arch: amd64
|
|
windows-display-name: 'Server 2025'
|
|
- windows-version: '11-arm'
|
|
arch: arm64
|
|
windows-display-name: '11 ARM'
|
|
steps:
|
|
- uses: compnerd/gha-setup-swift@main
|
|
with:
|
|
swift-version: ${{ env.SWIFT_VERSION }}
|
|
swift-build: ${{ env.SWIFT_BUILD }}
|
|
build_arch: ${{ matrix.arch }}
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
|
|
with:
|
|
key: windows-${{ matrix.windows-version }}-spm-${{ env.SWIFT_VERSION }}-${{ env.SWIFT_BUILD }}-${{ hashFiles('Package.resolved', 'Package.swift') }}
|
|
restore-keys: windows-${{ matrix.windows-version }}-spm-${{ env.SWIFT_VERSION }}-${{ env.SWIFT_BUILD }}-
|
|
path: .build
|
|
- name: Build all targets
|
|
run: swift build --build-tests
|
|
- name: Run selected tests
|
|
run: swift test --skip IntegrationTests --skip FileSystemAccessTests --skip FrameworkTests --skip BuiltInRulesTests
|
|
# To be extended with test execution and linting ...
|