Skip to content

tests

tests #408

Workflow file for this run

name: tests
on:
workflow_dispatch:
pull_request:
schedule:
- cron: '0 0 * * *' # Every day at midnight UTC
push:
branches:
- main
jobs:
compiletime-crash-tests:
name: Compiletime Crash Tests Swift ${{ matrix.swift }}
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
swift: ["6.0.3", "6.1.0", "6.2.0", "nightly-main"]
container: ${{ contains(matrix.swift, 'nightly') && format('swiftlang/swift:{0}', matrix.swift) || format('swift:{0}', matrix.swift) }}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Verify Python version
run: python --version
- name: Install dependencies
run: |
python -m pip install "pandas~=2.2" "influxdb_client~=1.48" "result~=0.17" "typeguard~=4.4"
- name: Verify package installation
run: python -c "import pandas as pd; print(pd.__version__); import influxdb_client; print(influxdb_client.__version__)"
- name: Run compiletime crash tests
env:
SWIFT_VERSION: ${{ matrix.swift }}
run: (cd CompiletimeCrashTests && ./run-compiletime-crash-tests.sh)
- name: Upload to Influx
if: ${{ github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
env:
INFLUX_BUCKET_NAME: ${{ secrets.InfluxBucketName }}
INFLUX_UPLOAD_TOKEN: ${{ secrets.InfluxUploadToken }}
INFLUX_ORG_NAME: ${{ secrets.InfluxOrgName }}
INFLUX_URL: ${{ secrets.InfluxURL }}
SWIFT_VERSION: ${{ matrix.swift }}
run: cd CompiletimeCrashTests && python test-upload.py
compiletime-crash-tests-macos:
name: Compiletime Crash Tests Swift ${{ matrix.swift }} on macOS
runs-on: macos-15
strategy:
fail-fast: false
matrix:
swift: ["6.0.3", "6.1.0", "6.2.0", "main-snapshot"]
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Verify Python version
run: python --version
- name: Install dependencies
run: |
python -m pip install "pandas~=2.2" "influxdb_client~=1.48" "result~=0.17" "typeguard~=4.4"
- name: Verify package installation
run: python -c "import pandas as pd; print(pd.__version__); import influxdb_client; print(influxdb_client.__version__)"
- name: Install swiftly
run: |
curl -O https://download.swift.org/swiftly/darwin/swiftly.pkg && \
installer -pkg swiftly.pkg -target CurrentUserHomeDirectory && \
~/.swiftly/bin/swiftly init --quiet-shell-followup && \
. ~/.swiftly/env.sh && \
hash -r
echo "${HOME}/.swiftly/bin" >> $GITHUB_PATH
- name: Install Swift ${{ matrix.swift }}
run: swiftly install --use ${{ matrix.swift }}
- name: Check Swift Installation
run: swift --version
- name: Run compiletime crash tests
env:
SWIFT_VERSION: ${{ matrix.swift }}
run: cd CompiletimeCrashTests && ./run-compiletime-crash-tests.sh
- name: Upload to Influx
if: ${{ github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
env:
INFLUX_BUCKET_NAME: ${{ secrets.InfluxBucketName }}
INFLUX_UPLOAD_TOKEN: ${{ secrets.InfluxUploadToken }}
INFLUX_ORG_NAME: ${{ secrets.InfluxOrgName }}
INFLUX_URL: ${{ secrets.InfluxURL }}
SWIFT_VERSION: ${{ matrix.swift }}
run: cd CompiletimeCrashTests && python test-upload.py
runtime-crash-tests:
name: Runtime Crash Tests Swift ${{ matrix.swift }}
runs-on: ubuntu-latest
strategy:
matrix:
swift: ["6.0.3"]
container: swift:${{ matrix.swift }}
steps:
- uses: actions/checkout@v4
- run: (cd RuntimeCrashTests && ./run-runtime-crash-tests.sh)
runtime-validation-tests:
name: Runtime Validation Tests Swift ${{ matrix.swift }}
strategy:
matrix:
swift: ["6.0.3"]
runs-on: ubuntu-latest
container: swift:${{ matrix.swift }}
steps:
- uses: actions/checkout@v4
- name: Build RuntimeValidationTests
run: swift build --package-path RuntimeValidationTests
- name: Test RuntimeValidationTests
run: swift test --package-path RuntimeValidationTests