Update CI (#42)

* Split CI actions into dedicated files

* Fix pipelines

* Rename pipeline jobs

* Update README
This commit is contained in:
Christian Treffs 2021-06-10 02:03:03 +02:00 committed by GitHub
parent 0161470415
commit 2aaef3d111
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 134 additions and 84 deletions

39
.github/workflows/ci-linux.yml vendored Normal file
View File

@ -0,0 +1,39 @@
name: Linux
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
linux-test-build-release:
runs-on: ubuntu-latest
strategy:
matrix:
swift: ["5.1", "latest"]
container:
image: swift:${{ matrix.swift }}
steps:
- name: Checkout
uses: actions/checkout@master
- name: "Update APT"
shell: bash
run: "apt update"
- name: "Install curl"
shell: bash
run: "apt-get install -y curl"
- name: Swift version
run: swift --version
- name: Test
run: swift test -v --skip-update --parallel --enable-test-discovery --enable-code-coverage
- name: Generate coverage report
run: llvm-cov export -format="lcov" .build/debug/*PackageTests.xctest -instr-profile .build/debug/codecov/default.profdata > coverage.lcov
- name: Upload code coverage report
uses: codecov/codecov-action@master
with:
token: ${{secrets.CODECOV_TOKEN}}
file: coverage.lcov
fail_ci_if_error: true
- name: Build Release
run: swift build -c release

35
.github/workflows/ci-macos.yml vendored Normal file
View File

@ -0,0 +1,35 @@
name: macOS
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
macos-test-build-release-xcode:
runs-on: macOS-latest
strategy:
matrix:
xcode: ["11.7", "12.4"]
steps:
- name: Checkout
uses: actions/checkout@master
- name: Select Xcode ${{ matrix.xcode }}
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app
- name: Test
run: swift test -v --skip-update --parallel --enable-test-discovery --enable-code-coverage
env:
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer
- name: Generate coverage report
run: xcrun llvm-cov export -format="lcov" .build/debug/*PackageTests.xctest/Contents/MacOS/*PackageTests -instr-profile .build/debug/codecov/default.profdata > coverage.lcov
- name: Upload code coverage report
uses: codecov/codecov-action@master
with:
token: ${{secrets.CODECOV_TOKEN}}
file: coverage.lcov
fail_ci_if_error: true
- name: Build Release
run: swift build -c release
env:
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer

17
.github/workflows/ci-wasm.yml vendored Normal file
View File

@ -0,0 +1,17 @@
name: WASM
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
wasm-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Build
uses: swiftwasm/swiftwasm-action@main
with:
shell-action: swift build --triple wasm32-unknown-wasi

38
.github/workflows/ci-windows.yml vendored Normal file
View File

@ -0,0 +1,38 @@
name: Windows
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
windows-test-build-release:
runs-on: windows-latest
env:
SNAPSHOT: "https://swift.org/builds/swift-5.4.1-release/windows10/swift-5.4.1-RELEASE/swift-5.4.1-RELEASE-windows10.exe"
steps:
- uses: actions/checkout@master
- uses: seanmiddleditch/gha-setup-vsdevenv@master
- name: Install Swift
run: |
Install-Binary -Url "${env:SNAPSHOT}" -Name "installer.exe" -ArgumentList ("-q")
- name: Set Environment Variables
run: |
echo "SDKROOT=C:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "DEVELOPER_DIR=C:\Library\Developer" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Adjust Paths
run: |
echo "C:\Library\Swift-development\bin;C:\Library\icu-67\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Install Supporting Files
run: |
Copy-Item "$env:SDKROOT\usr\share\ucrt.modulemap" -destination "$env:UniversalCRTSdkDir\Include\$env:UCRTVersion\ucrt\module.modulemap"
Copy-Item "$env:SDKROOT\usr\share\visualc.modulemap" -destination "$env:VCToolsInstallDir\include\module.modulemap"
Copy-Item "$env:SDKROOT\usr\share\visualc.apinotes" -destination "$env:VCToolsInstallDir\include\visualc.apinotes"
Copy-Item "$env:SDKROOT\usr\share\winsdk.modulemap" -destination "$env:UniversalCRTSdkDir\Include\$env:UCRTVersion\um\module.modulemap"
- name: Test
run: swift test -v --skip-update --parallel --enable-test-discovery
- name: Build Release
run: swift build -c release

View File

@ -1,81 +0,0 @@
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
macOS:
runs-on: macOS-latest
strategy:
matrix:
xcode: ["11.7", "12.2"]
steps:
- name: Checkout
uses: actions/checkout@master
- name: Select Xcode ${{ matrix.xcode }}
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app
- name: Swift version
run: swift --version
- name: Test
run: swift test -v --skip-update --parallel --enable-test-discovery --enable-code-coverage
env:
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer
- name: Generate coverage report
run: xcrun llvm-cov export -format="lcov" .build/debug/*PackageTests.xctest/Contents/MacOS/*PackageTests -instr-profile .build/debug/codecov/default.profdata > coverage.lcov
- name: Upload code coverage report
uses: codecov/codecov-action@master
with:
token: ${{secrets.CODECOV_TOKEN}}
file: coverage.lcov
fail_ci_if_error: true
- name: Build Release
run: swift build -c release
env:
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer
linux:
runs-on: ubuntu-latest
strategy:
matrix:
swift: ["5.1", "latest"]
container:
image: swift:${{ matrix.swift }}
steps:
- name: Checkout
uses: actions/checkout@master
- name: "Update APT"
shell: bash
run: "apt update"
- name: "Install curl"
shell: bash
run: "apt-get install -y curl"
- name: Swift version
run: swift --version
- name: Test
run: swift test -v --skip-update --parallel --enable-test-discovery --enable-code-coverage
- name: Generate coverage report
run: llvm-cov export -format="lcov" .build/debug/*PackageTests.xctest -instr-profile .build/debug/codecov/default.profdata > coverage.lcov
- name: Upload code coverage report
uses: codecov/codecov-action@master
with:
token: ${{secrets.CODECOV_TOKEN}}
file: coverage.lcov
fail_ci_if_error: true
- name: Build Release
run: swift build -c release
webAssembly:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@master
- name: Swift version
run: swift --version
- name: Build
uses: swiftwasm/swiftwasm-action@main
with:
shell-action: swift build --triple wasm32-unknown-wasi

View File

@ -1,11 +1,13 @@
# Fireblade ECS (Entity-Component System)
[![license](https://img.shields.io/badge/license-MIT-brightgreen.svg)](LICENSE)
[![github CI](https://github.com/fireblade-engine/ecs/workflows/CI/badge.svg)](https://github.com/fireblade-engine/ecs/actions?query=workflow%3ACI)
[![codecov](https://codecov.io/gh/fireblade-engine/ecs/branch/master/graph/badge.svg)](https://codecov.io/gh/fireblade-engine/ecs)
[![macOS](https://github.com/fireblade-engine/ecs/actions/workflows/ci-macos.yml/badge.svg)](https://github.com/fireblade-engine/ecs/actions/workflows/ci-macos.yml)
[![Linux](https://github.com/fireblade-engine/ecs/actions/workflows/ci-linux.yml/badge.svg)](https://github.com/fireblade-engine/ecs/actions/workflows/ci-linux.yml)
[![Windows](https://github.com/fireblade-engine/ecs/actions/workflows/ci-windows.yml/badge.svg)](https://github.com/fireblade-engine/ecs/actions/workflows/ci-windows.yml)
[![WASM](https://github.com/fireblade-engine/ecs/actions/workflows/ci-wasm.yml/badge.svg)](https://github.com/fireblade-engine/ecs/actions/workflows/ci-wasm.yml)
[![documentation](https://github.com/fireblade-engine/ecs/workflows/Documentation/badge.svg)](https://github.com/fireblade-engine/ecs/wiki)
[![codecov](https://codecov.io/gh/fireblade-engine/ecs/branch/master/graph/badge.svg)](https://codecov.io/gh/fireblade-engine/ecs)
[![spi-swift-versions](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Ffireblade-engine%2Fecs%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/fireblade-engine/ecs)
[![spi-swift-platforms](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Ffireblade-engine%2Fecs%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/fireblade-engine/ecs)
[![platform-webassembly](https://img.shields.io/badge/Platform-WebAssembly-blue.svg)](https://github.com/swiftwasm/swift#swiftwasm)
This is a **dependency free**, **lightweight**, **fast** and **easy to use** [Entity-Component System](https://en.wikipedia.org/wiki/Entity_component_system) implementation in Swift. It is developed and maintained as part of the [Fireblade Game Engine project](https://github.com/fireblade-engine).