Skip to content

Main

Main #249

Workflow file for this run

name: Main
on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: '0 0 * * 0'
jobs:
main:
runs-on: ${{ matrix.image }}
strategy:
matrix:
image: [macos-14, ubuntu-24.04, windows-2025]
fail-fast: false
env:
DOTNET_NOLOGO: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1
steps:
- uses: actions/checkout@v5
- if: matrix.image == 'ubuntu-22.04'
name: Free disk space
uses: jlumbroso/[email protected]
with:
tool-cache: false
large-packages: false
- name: dotnet.cmd cache
uses: actions/cache@v4
with:
path: ${{ runner.os == 'Windows' && '~/AppData/Local/JetBrains/dotnet-cmd' || '~/.local/share/JetBrains/dotnet-cmd' }}
key: ${{ runner.os }}-dotnet-${{ hashFiles('dotnet.cmd') }}
- name: 'Cache downloaded JDK'
uses: actions/cache@v4
with:
path: |
~/.local/share/gradle-jvm
~/AppData/Local/gradle-jvm
key: ${{ runner.os }}-${{ hashFiles('gradlew*') }}
# Common preparation
- name: Prepare build
run: ./gradlew prepare
# Backend
- name: Build the backend
run: ./dotnet.cmd build --configuration Release
- name: Test the backend
run: ./dotnet.cmd test --configuration Release --no-build --logger trx
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: ${{ runner.os }}.test-results
path: "src/dotnet/Tests/TestResults/*.trx"
# Frontend
- name: Build the plugin
run: ./gradlew build buildPlugin -PbuildConfiguration=Release
- if: matrix.image == 'ubuntu-22.04'
id: version
name: Determine the version
shell: pwsh
run: '"version=$(./scripts/Get-Version.ps1)" >> $env:GITHUB_OUTPUT'
- name: Unpack distribution # for uploading
shell: pwsh
run: scripts/Unpack-Distribution.ps1
- if: matrix.image == 'ubuntu-22.04'
name: Upload the artifact
uses: actions/upload-artifact@v4
with:
name: rider-trx-plugin-${{ steps.version.outputs.version }}
path: build/distributions/unpacked
validation:
runs-on: ubuntu-22.04
name: "Validate Gradle wrapper"
steps:
- uses: actions/checkout@v5
- uses: gradle/actions/wrapper-validation@v4