I have a Visual Studio Solution with 3 projects. These are the main web application project, a unit test project and finally at Selenium, NUnit, SpecFlow regression test project.
I am trying to setup CI/CD in GitHub actions and so far I have in my yaml file 2 jobs.
Job 1 runs the unit tests project against the web project and this passes
tests: name: Unit Testing runs-on: windows-latest steps: - uses: actions/[email protected] - run: dotnet test --no-build --verbosity normal
Job 2 builds the web project
build: name: BuildProject runs-on: windows-latest steps: - uses: actions/[email protected] - name: Setup .NET uses: actions/[email protected] with: dotnet-version: 5.0.x - name: Restore dependencies run: dotnet restore - name: Build run: dotnet build --no-restore
What I want to do now is add a third job, this job will run the selenium test suite against the main web project but I cannot figure out how to get this running from the yaml file.
Can anyone point me towards a good step through or example please.
Cheers
Kev
So now I have added this job
regression: needs: tests name: Regression tests runs-on: windows-latest steps: - uses: actions/[email protected] - run: dotnet test SpiceTheWorld.Regression --no-restore --verbosity normal
This appears to run with no errors but it completes in 20 seconds, running the same on command line takes 40 seconds so I am not sure it is actually running.
This is the output
Answer
Thanks for your help. I have it working now, below is the script.
name: Spicethedeploy on: push: branches: [ development ] pull_request: branches: [ development ] jobs: build: name: Buildspice runs-on: windows-latest steps: - uses: actions/[email protected] - name: Setup .NET Core SDK ${{ matrix.dotnet-version }} uses: actions/[email protected] with: dotnet-version: ${{ matrix.dotnet-version }} - name: Install dependencies run: dotnet restore - name: Build run: dotnet build --configuration Release --no-restore unittests: needs: build name: Unit Testing runs-on: windows-latest steps: - uses: actions/[email protected] - name: Setup .NET Core SDK ${{ matrix.dotnet-version }} uses: actions/[email protected] with: dotnet-version: ${{ matrix.dotnet-version }} - name: Install dependencies run: dotnet restore - name: Unit Tests run: dotnet test SpiceTheWorld.Tests --no-restore --verbosity Minimal regression: needs: unittests name: Regression runs-on: windows-latest steps: - uses: actions/[email protected] - name: Setup .NET Core SDK ${{ matrix.dotnet-version }} uses: actions/[email protected] with: dotnet-version: ${{ matrix.dotnet-version }} - name: Install dependencies run: dotnet restore - name: Regression tests run: dotnet test SpiceTheWorld.Regression --no-restore --verbosity Minimal --filter TestCategory=SpiceRegression