Skip to content

Continuous Integration #2956

Continuous Integration

Continuous Integration #2956

Workflow file for this run

##############################################################################
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
name: Continuous Integration
on:
push:
branches: [ main ]
pull_request_target:
branches:
- '*'
schedule:
- cron: '0 0,12 * * *'
jobs:
ci-linux:
runs-on: ubuntu-latest
timeout-minutes: 90
env:
FAIRHUB_API_SKIP: true # used by tests to determine load
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Get swift version
run: swift --version
- name: Checkout
uses: actions/checkout@v3
- name: Run fairtool
run: |
swift run fairtool version
- name: Fair Test Linux (Debug)
run: swift test -v --configuration debug --parallel
- name: Fair Test Linux (Release)
run: swift test -v --configuration release -Xswiftc -enable-testing --parallel
- name: Check fairtool formula
if: false
run: |
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
brew install fair-ground/tool/fairtool-head
brew test fairtool-head
fairtool-head version
ci-macOS:
runs-on: macos-12
timeout-minutes: 90
env:
DEVELOPER_DIR: /Applications/Xcode_14.1.app/Contents/Developer
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FAIRHUB_API_SKIP: true # used by tests to determine load
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Test iOS (Debug)
run: xcodebuild test -configuration Debug -scheme "Fair-Package" -sdk "iphonesimulator" -destination "platform=iOS Simulator,name=iPhone 14 Pro"
- name: Test iOS (Release)
run: xcodebuild test -configuration Release -scheme "Fair-Package" -sdk "iphonesimulator" -destination "platform=iOS Simulator,name=iPhone 14 Pro"
- name: Test macOS (Debug)
run: xcodebuild test -configuration Debug -scheme "Fair-Package" -sdk "macosx" -destination "platform=macosx"
- name: Test macOS (Release)
run: xcodebuild test -configuration Release -scheme "Fair-Package" -sdk "macosx" -destination "platform=macosx"
- name: Test Package
run: xcrun swift test --parallel
- name: Run fairtool
run: xcrun swift run fairtool version
- name: Check fairtool formula
run: |
export HOMEBREW_NO_INSTALL_CLEANUP=1
brew install fair-ground/tool/fairtool-head
brew test fairtool-head
fairtool-head version
#fairtool-head app fork App-Name
#fairtool-head app config App-Name
#fairtool-head app release App-Name
#fairtool-head app integrate App-Name
api-doc:
runs-on: macos-12
timeout-minutes: 20
env:
DEVELOPER_DIR: /Applications/Xcode_14.0.1.app/Contents/Developer
steps:
- uses: actions/checkout@v3
- name: Build documentation
run: |
swift -version
export SWIFTPM_ENABLE_COMMAND_PLUGINS=1
export DOCC_JSON_PRETTYPRINT="YES"
# add in the docc plugin to generate the docs
sed -I "" 's;^ *dependencies: \[ *$;dependencies: \[ .package(name: "swift-docc-plugin", url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"),;g' Package.swift
# until https://github.com/apple/swift-docc/issues/255
# is implemented, we can only have a single target,
# so we copy all the FairCore files into FairApp
# cp -v Sources/FairCore/*.swift Sources/FairApp
# FairApp
swift package --allow-writing-to-directory docs \
generate-documentation --target FairApp \
--disable-indexing \
--transform-for-static-hosting \
--hosting-base-path Fair \
--output-path docs
# FairCore
swift package --allow-writing-to-directory docs-faircore \
generate-documentation --target FairCore \
--disable-indexing \
--transform-for-static-hosting \
--hosting-base-path Fair \
--output-path docs-faircore
cp -R "docs-faircore/data/documentation/"* "docs/data/documentation/"
cp -R "docs-faircore/documentation/"* "docs/documentation/"
rm -r docs-faircore
# FairKit
swift package --allow-writing-to-directory docs-fairkit \
generate-documentation --target FairKit \
--disable-indexing \
--transform-for-static-hosting \
--hosting-base-path Fair \
--output-path docs-fairkit
cp -R "docs-fairkit/data/documentation/"* "docs/data/documentation/"
cp -R "docs-fairkit/documentation/"* "docs/documentation/"
rm -r docs-fairkit
# FairExpo
swift package --allow-writing-to-directory docs-fairexpo \
generate-documentation --target FairExpo \
--disable-indexing \
--transform-for-static-hosting \
--hosting-base-path Fair \
--output-path docs-fairexpo
cp -R "docs-fairexpo/data/documentation/"* "docs/data/documentation/"
cp -R "docs-fairexpo/documentation/"* "docs/documentation/"
rm -r docs-fairexpo
# FairTool executable
swift package --allow-writing-to-directory docs-fairtool \
generate-documentation --target fairtool \
--disable-indexing \
--transform-for-static-hosting \
--hosting-base-path Fair \
--output-path docs-fairtool
cp -R "docs-fairtool/data/documentation/"* "docs/data/documentation/"
cp -R "docs-fairtool/documentation/"* "docs/documentation/"
rm -r docs-fairtool
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: '.'