Skip to content

- WIP

- WIP #1232

Workflow file for this run

name: Builds
on:
push:
pull_request:
permissions:
contents: write
env:
BUILD_VERSION: 2.5.0.${{ github.run_number }}
jobs:
windows-build:
name: Windows Build
runs-on: windows-latest
timeout-minutes: 15
env:
NUGET_ENABLE_LEGACY_CSPROJ_PACK: true
steps:
- name: Set net7.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
- name: View Build Version
run: echo ${{ env.BUILD_VERSION }}
- name: View Github Info
run: echo repository=${{ github.repository }} event_name=${{ github.event_name }} ref=${{ github.ref }} head_ref=${{ github.head_ref }} base_ref=${{ github.base_ref }}
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup MSBuild
uses: microsoft/[email protected]
- name: Setup Nuget.exe
uses: nuget/setup-nuget@v1
- name: Restore nuget Packages
run: dotnet restore Source/Mosa.sln
- name: Build
run: dotnet build Source/Mosa.sln /p:Version=${{ env.BUILD_VERSION }}
- name: Unit Test
run: dotnet test Source/Mosa.sln
- name: Cleanup
run: cmd.exe /C "rmdir /s /q bin\reko bin\cs bin\de bin\es bin\fr bin\it bin\ja bin\ko bin\pl bin\pt-BR bin\ru bin\tr bin\zh-Hans bin\zh-Hant"
- name: Store Build Artifact
uses: actions/upload-artifact@v3
with:
name: windows-build-artifact
path: bin
- name: Create Package - Mosa.Tools.Package
run: nuget pack Source\Mosa.Packages\Mosa.Tools.Package.nuspec -Tool -OutputDirectory bin\nupkg -Version ${{ env.BUILD_VERSION }}
- name: Create Package - Mosa.Tools.Package.Qemu
run: nuget pack Source\Mosa.Packages\Mosa.Tools.Package.Qemu.nuspec -Tool -OutputDirectory bin\nupkg -Version ${{ env.BUILD_VERSION }}
- name: Create Package - Mosa.Platform
run: nuget pack Source\Mosa.Packages\Mosa.Platform.nuspec -OutputDirectory bin\nupkg -Version ${{ env.BUILD_VERSION }}
- name: Create Package - Mosa.Platform.x86
run: nuget pack Source\Mosa.Packages\Mosa.Platform.x86.nuspec -OutputDirectory bin\nupkg -Version ${{ env.BUILD_VERSION }}
- name: Create Package - Mosa.DeviceSystem
run: nuget pack Source\Mosa.Packages\Mosa.DeviceSystem.nuspec -OutputDirectory bin\nupkg -Version ${{ env.BUILD_VERSION }}
- name: Build Project - Mosa.Templates
run: dotnet build Source\Mosa.Templates\Mosa.Templates.csproj
- name: Create Package - Mosa.Templates
run: nuget pack Source\Mosa.Templates\Mosa.Templates.csproj -Tool -OutputDirectory bin\nupkg -Version ${{ env.BUILD_VERSION }}
- name: Store Nuget Packages Artifact
uses: actions/upload-artifact@v3
with:
name: Nuget Packages
path: bin\nupkg
windows-build-packaging:
name: Windows Build Packaging
needs: [windows-build, linux-build, macos-build, generate-docs, windows-unit-testing, linux-unit-testing, macos-unit-testing, windows-demo-testing, linux-demo-testing, macos-demo-testing]
runs-on: windows-latest
timeout-minutes: 15
if: github.event_name == 'push' && github.repository == 'mosa/MOSA-Project' && github.ref == 'refs/heads/master'
env:
NUGET_ENABLE_LEGACY_CSPROJ_PACK: true
steps:
- name: Set net7.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
- name: View Build Version
run: echo ${{ env.BUILD_VERSION }}
- name: View Github Info
run: echo repository=${{ github.repository }} event_name=${{ github.event_name }} ref=${{ github.ref }} head_ref=${{ github.head_ref }} base_ref=${{ github.base_ref }}
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Download Nuget Packages Artifact
uses: actions/download-artifact@v3
with:
name: Nuget Packages
path: bin\nupkg
- name: Publish Package - Mosa.Tools.Package
run: dotnet nuget push bin\nupkg\Mosa.Tools.Package.${{ env.BUILD_VERSION }}.nupkg -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json
- name: Publish Package - Mosa.Tools.Package.Qemu
run: dotnet nuget push bin\nupkg\Mosa.Tools.Package.Qemu.${{ env.BUILD_VERSION }}.nupkg -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json
- name: Publish Package - Mosa.Platform
run: dotnet nuget push bin\nupkg\Mosa.Platform.${{ env.BUILD_VERSION }}.nupkg -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json
- name: Publish Package - Mosa.Platform.x86
run: dotnet nuget push bin\nupkg\Mosa.Platform.x86.${{ env.BUILD_VERSION }}.nupkg -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json
- name: Publish Package - Mosa.DeviceSystem
run: dotnet nuget push bin\nupkg\Mosa.DeviceSystem.${{ env.BUILD_VERSION }}.nupkg -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json
- name: Publish Package - Mosa.Templates
run: dotnet nuget push bin\nupkg\Mosa.Templates.${{ env.BUILD_VERSION }}.nupkg -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json
linux-build:
name: Linux Build
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Set net7.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
- name: View Build Version
run: echo ${{ env.BUILD_VERSION }}
- name: View Github Info
run: echo repository=${{ github.repository }} event_name=${{ github.event_name }} ref=${{ github.ref }} head_ref=${{ github.head_ref }} base_ref=${{ github.base_ref }}
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Restore nuget Packages
run: dotnet restore Source/Mosa.Linux.sln
- name: Build
run: dotnet build Source/Mosa.Linux.sln
- name: Unit Test
run: dotnet test Source/Mosa.Linux.sln
- name: Store Build Artifact
uses: actions/upload-artifact@v3
with:
name: linux-build-artifact
path: bin
macos-build:
name: MacOS Build
runs-on: macos-latest
timeout-minutes: 15
steps:
- name: Set net7.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
- name: View Build Version
run: echo ${{ env.BUILD_VERSION }}
- name: View Github Info
run: echo repository=${{ github.repository }} event_name=${{ github.event_name }} ref=${{ github.ref }} head_ref=${{ github.head_ref }} base_ref=${{ github.base_ref }}
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Restore nuget Packages
run: dotnet restore Source/Mosa.Linux.sln
- name: Build
run: dotnet build Source/Mosa.Linux.sln
- name: Unit Test
run: dotnet test Source/Mosa.Linux.sln
- name: Store Build Artifact
uses: actions/upload-artifact@v3
with:
name: macos-build-artifact
path: bin
generate-docs:
name: Generate Documentation
runs-on: ubuntu-latest
timeout-minutes: 15
if: github.event_name == 'push' && github.repository == 'mosa/MOSA-Project' && github.ref == 'refs/heads/master'
steps:
- name: Set python3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Update package repository
run: sudo apt-get -y -o Acquire::Check-Valid-Until=false update
- name: Install Graphviz
run: sudo apt-get install -y graphviz
- name: Install Sphinx dependencies
run: pip3 install sphinx sphinxcontrib.httpdomain sphinx-prompt sphinx_rtd_theme sphinx-tabs
- name: Generate HTML website
run: sphinx-build -b html Source/Docs sphinx-docs
- name: Copy CNAME file
run: cp Source/Docs/CNAME sphinx-docs/
- name: Copy .nojekyll file
run: cp Source/Docs/.nojekyll sphinx-docs/
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: sphinx-docs
branch: docs
windows-unit-testing:
strategy:
matrix:
optimization: [0,1,2,3,4,5,6,7,8,9]
fail-fast: false
name: Windows - Unit Test -o${{ matrix.optimization }}
runs-on: windows-latest
timeout-minutes: 15
needs: windows-build
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Download Build Artifact
uses: actions/download-artifact@v3
with:
name: windows-build-artifact
path: bin
- name: Unit Test
run: bin\Mosa.Utility.UnitTests.exe -check -o${{ matrix.optimization }}
linux-unit-testing:
strategy:
matrix:
optimization: [0,1,2,3,4,5,6,7,8,9]
fail-fast: false
name: Linux - Unit Test -o${{ matrix.optimization }}
runs-on: ubuntu-latest
timeout-minutes: 15
needs: linux-build
steps:
- name: Set net7.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Download Build Artifact
uses: actions/download-artifact@v3
with:
name: linux-build-artifact
path: bin
- name: Update Package Respository
run: sudo apt-get -y -o Acquire::Check-Valid-Until=false update
- name: Install Qemu and Dependencies
run: sudo apt-get -y -o Acquire::Retries=5 install qemu-system-x86
- name: Unit Test
run: dotnet bin/Mosa.Utility.UnitTests.dll -check -o${{ matrix.optimization }}
macos-unit-testing:
strategy:
matrix:
optimization: [0,1,2,3,4,5,6,7,8,9]
fail-fast: false
name: MacOS - Unit Test -o${{ matrix.optimization }}
runs-on: macos-latest
timeout-minutes: 15
needs: macos-build
steps:
- name: Set net7.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Download Build Artifact
uses: actions/download-artifact@v3
with:
name: macos-build-artifact
path: bin
- name: Unit Test
run: dotnet bin/Mosa.Utility.UnitTests.dll -check -o${{ matrix.optimization }}
windows-demo-testing:
strategy:
matrix:
optimization: [0,1,2,3,4,5,6,7,8,9]
fail-fast: false
name: Windows - Demo Test -o${{ matrix.optimization }}
runs-on: windows-latest
timeout-minutes: 15
needs: windows-build
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Download Build Artifact
uses: actions/download-artifact@v3
with:
name: windows-build-artifact
path: bin
- name: Demo Test - BareMetal HelloWorld
run: bin\Mosa.Tool.Launcher.Console.exe bin\Mosa.BareMetal.HelloWorld.x86.dll -o${{ matrix.optimization }} -check -test
- name: Demo Test - BareMetal GraphicalWorld
run: bin\Mosa.Tool.Launcher.Console.exe bin\Mosa.BareMetal.GraphicalWorld.x86.dll -o${{ matrix.optimization }} -check -test -vmware-svga -include bin\Include
linux-demo-testing:
strategy:
matrix:
optimization: [0,1,2,3,4,5,6,7,8,9]
fail-fast: false
name: Linux - Demo Test -o${{ matrix.optimization }}
runs-on: ubuntu-latest
timeout-minutes: 15
needs: linux-build
steps:
- name: Set net7.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Download Build Artifact
uses: actions/download-artifact@v3
with:
name: linux-build-artifact
path: bin
- name: Update Package Respository
run: sudo apt-get -y -o Acquire::Check-Valid-Until=false update
- name: Install Qemu and Dependencies
run: sudo apt-get -y -o Acquire::Retries=5 install qemu-system-x86
- name: Demo Test - BareMetal HelloWorld
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.HelloWorld.x86.dll -o${{ matrix.optimization }} -check -test
- name: Demo Test - BareMetal GraphicalWorld
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.GraphicalWorld.x86.dll -o${{ matrix.optimization }} -check -test -vmware-svga -include bin/Include
macos-demo-testing:
strategy:
matrix:
optimization: [0,1,2,3,4,5,6,7,8,9]
fail-fast: false
name: MacOS - Demo Test -o${{ matrix.optimization }}
runs-on: macos-latest
timeout-minutes: 15
needs: macos-build
steps:
- name: Set net7.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Download Build Artifact
uses: actions/download-artifact@v3
with:
name: macos-build-artifact
path: bin
- name: Demo Test - BareMetal HelloWorld
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.HelloWorld.x86.dll -o${{ matrix.optimization }} -check -test
- name: Demo Test - BareMetal GraphicalWorld
run: dotnet bin/Mosa.Tool.Launcher.Console.dll bin/Mosa.BareMetal.GraphicalWorld.x86.dll -o${{ matrix.optimization }} -check -test -vmware-svga -include bin/Include