Skip to content

Commit

Permalink
Test new workflow files
Browse files Browse the repository at this point in the history
  • Loading branch information
lbuesching committed Jan 11, 2024
1 parent 7e7f7fb commit c621393
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 53 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net

name: Build And Test

on:
workflow_call:
inputs:
environment:
description: Environment to run tests against
type: string
default: CI
test_args:
description: Additional arguments to dotnet test
type: string
build_configuration:
description: Whether to build debug or release configuration of the code
type: string
default: debug

jobs:
build_test_archive:
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Restore dependencies
working-directory: ./src
run: dotnet restore
- name: Build
working-directory: ./src
run: dotnet build --configuration {{ inputs.build_configuration }} --no-restore
- name: Upload Sage Build
uses: actions/upload-artifact@v3
with:
name: SageWebhost
path: Sage.Webhost/bin/{{ inputs.build_configuration }}/net8.0/
retention-days: 7
- name: Test
working-directory: ./src
run: dotnet test --no-build --verbosity normal {{ inputs.test_args }}
45 changes: 27 additions & 18 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,35 @@ name: CI Tests

on:
push:
branches: [ "main" ]
branches: [ "main", "release", "ci-dev" ]
pull_request:
branches: [ "main" ]
branches: [ "main", "release", "ci-dev" ]

jobs:
build:
init:
runs-on: ubuntu-latest

outputs:
build_configuration: ${{ steps.set_buildconfig.outputs.build_configuration }}
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Restore dependencies
working-directory: ./src
run: dotnet restore
- name: Build
working-directory: ./src
run: dotnet build --no-restore
- name: Test
working-directory: ./src
run: dotnet test --no-build --verbosity normal --filter TestCategory!="Compatibility"
- name: Set release configuration for release branches
id: set_buildconfig
run: |
if [[ "${{github.base_ref}}" == "release" ]]; then
echo "::set-output name=build_configuration::release"
else
echo "::set-output name=build_configuration::debug"
fi
build_test:
uses: ./.github/workflows/build_test.yml
needs: init
with:
test_args: --filter TestCategory!="Compatibility"
build_configuration: ${{ needs.init.outputs.build_configuration }}
build_test_backward_compatibility:
uses: ./.github/workflows/build_test.yml
needs: init
with:
environment: "MC Integration"
test_args: --filter TestCategory="Compatibility"
build_configuration: ${{ needs.init.outputs.build_configuration }}
35 changes: 0 additions & 35 deletions .github/workflows/compatibility_tests.yml

This file was deleted.

0 comments on commit c621393

Please sign in to comment.