diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..d86d9ff90 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,50 @@ +name: CI + +on: + push: + branches: [ master ] + pull_request: + +permissions: + contents: read + +# Cancel superseded runs for the same branch/PR. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + name: Build & Test + # Windows is required because the library and test suite also target .NET Framework (net47). + runs-on: windows-latest + + steps: + - name: Checkout + uses: actions/checkout@v7 + with: + submodules: recursive + + - name: Setup .NET + uses: actions/setup-dotnet@v6 + with: + dotnet-version: | + 8.0.x + 10.0.x + + - name: Restore + run: dotnet restore YamlDotNet.sln + + - name: Build + run: dotnet build YamlDotNet.sln --configuration Release --no-restore + + - name: Test + run: dotnet test YamlDotNet.Test/YamlDotNet.Test.csproj --configuration Release --no-build --logger "trx;LogFileName=test-results.trx" + + - name: Upload test results + if: ${{ !cancelled() }} + uses: actions/upload-artifact@v7 + with: + name: test-results + path: '**/TestResults/*.trx' + if-no-files-found: ignore diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 1d4ed60e6..b091bc730 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -55,7 +55,7 @@ jobs: # your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v7 # Add any setup steps before running the `github/codeql-action/init` action. # This includes steps like installing compilers or runtimes (`actions/setup-node` diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 4ebae8357..3990d8251 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -17,24 +17,24 @@ jobs: DOTNET_CLI_TELEMETRY_OPTOUT: 1 steps: - name: Checkout the repository - uses: actions/checkout@v2 + uses: actions/checkout@v7 with: fetch-depth: 0 ref: ${{ github.event.inputs.ref }} # Make sure the required versions of dotnet core on the server - name: Install dotnet 3.1 - uses: actions/setup-dotnet@v3 + uses: actions/setup-dotnet@v6 with: dotnet-version: 3.1.x - name: Install dotnet 6.0 - uses: actions/setup-dotnet@v3 + uses: actions/setup-dotnet@v6 with: dotnet-version: 6.0.x - name: Install dotnet 8.0 - uses: actions/setup-dotnet@v3 + uses: actions/setup-dotnet@v6 with: dotnet-version: 8.0.x diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index cac127764..b0fc96daa 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -18,7 +18,7 @@ jobs: DOTNET_CLI_TELEMETRY_OPTOUT: 1 steps: - name: Checkout the repository - uses: actions/checkout@v2 + uses: actions/checkout@v7 with: fetch-depth: 0 ref: ${{ github.event.inputs.ref }}