Skip to content

Makes the devcontainer use our assertion-enabled binaries. #149

Makes the devcontainer use our assertion-enabled binaries.

Makes the devcontainer use our assertion-enabled binaries. #149

Workflow file for this run

name: Test
on:
push:
branches: [ main, rewrite ]
paths-ignore:
- "**.md"
- "LICENSE"
- ".gitignore"
pull_request:
branches: [ "**" ]
paths-ignore:
- "**.md"
- "LICENSE"
- ".gitignore"
jobs:
build-devcontainer:
name: "Devcontainer: ${{ matrix.host.os }}/${{ matrix.configuration }}"
strategy:
fail-fast: false
matrix:
host: [
{ type: linux, os: ubuntu-latest, test-options: --enable-code-coverage, }
]
configuration: [ "debug", "release" ]
runs-on: ${{ matrix.host.os }}
steps:
- name: Checkout (GitHub)
uses: actions/checkout@v3
- run: git config --global core.autocrlf input
- name: Build and run devcontainer task
uses: devcontainers/[email protected]
env:
HYLO_LLVM_BUILD_TYPE: ${{ matrix.configuration == 'debug' && 'Debug' || 'MinSizeRel' }}
with:
runCmd: swift test --parallel -v -c ${{ matrix.configuration }} ${{ matrix.host.test-options }}
build-native:
name: "Native: ${{ matrix.host.os }}/${{ matrix.configuration }}"
strategy:
fail-fast: false
matrix:
host: [
{ type: macos, os: macos-latest}
]
configuration: [ "debug", "release" ]
runs-on: ${{ matrix.host.os }}
steps:
- name: Checkout (GitHub)
uses: actions/checkout@v3
- run: git config --global core.autocrlf input
- name: Setup Swift
uses: swift-actions/setup-swift@v1
- run: swift --version
- name: Install LLVM
uses: KyleMayes/install-llvm-action@v1
with:
version: "15.0"
- run: llvm-config --version
- name: Configure pkgconfig
run: sudo ./Tools/make-pkgconfig.sh /usr/local/lib/pkgconfig/llvm.pc
- name: Test
run: swift test --enable-code-coverage -v -c ${{ matrix.configuration }} ${{ matrix.host.test-options }}
- name: Export Coverage
run: |
dot_os=(.build/${{ matrix.configuration }}/*.build/**/*.o)
bin_params=("${dot_os[0]}")
for o in "${dot_os[@]:1}"; do
bin_params+=("-object" "${o}")
done
llvm-cov export -format="lcov" -instr-profile "$(swift test -c ${{ matrix.configuration }} --show-codecov-path | xargs dirname)"/default.profdata "${bin_params[@]}" > info.lcov
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
flags: ${{ matrix.host.os }},${{ matrix.configuration }}
build-native-windows:
name: "Native: windows-latest/debug"
strategy:
fail-fast: false
runs-on: windows-latest
steps:
- name: Setup swift
uses: compnerd/[email protected]
with:
github-repo: thebrowsercompany/swift-build
release-asset-name: installer-amd64.exe
release-tag-name: 20231130.2
github-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4
with:
submodules: true
show-progress: false
- name: Swift version
run: swift --version
- name: Set up LLVM 15.0.6
run: |
curl.exe -L -O -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}"https://github.com/c3lang/win-llvm/releases/download/llvm_15_0_6/llvm-15.0.6-windows-x86-msvc17-msvcrt.7z
7z x llvm-15.0.6-windows-x86-msvc17-msvcrt.7z -oC:\
Add-Content $env:GITHUB_PATH 'C:\llvm-15.0.6-windows-x86-msvc17-msvcrt\bin'
- run: llvm-config --version
- name: Generate LLVM pkgconfig file
run: |
swift package resolve
& "C:\Program Files\Git\bin\bash.exe" Tools/make-pkgconfig.sh llvm.pc
type llvm.pc
- run: llvm-config --version
- name: Prevent reentrant builds for speed
run: echo 'SPM_BUILD_TOOL_SUPPORT_NO_REENTRANT_BUILD=1' >> $env:GITHUB_ENV
- name: Build (Debug)
run: swift build --explicit-target-dependency-import-check error --build-tests --pkg-config-path .
- name: Test (Debug)
run: swift test --parallel --skip-build --pkg-config-path .