NO-JIRA Configure CI #2
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Test | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
services: | |
activemq: | |
image: apache/activemq-artemis:latest | |
ports: | |
- 61616:61616 | |
- 8161:8161 | |
env: | |
ARTEMIS_USER: admin | |
ARTEMIS_PASSWORD: admin | |
options: >- | |
--health-cmd "curl -f http://localhost:8161/console || exit 1" | |
--health-interval 30s | |
--health-timeout 10s | |
--health-retries 5 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '9.0.x' | |
- name: Wait for ActiveMQ Artemis to be ready | |
run: | | |
echo "Waiting for ActiveMQ Artemis to start..." | |
timeout 300 bash -c 'until curl -f http://localhost:8161/console; do sleep 5; done' | |
echo "ActiveMQ Artemis is ready!" | |
- name: Restore dependencies | |
run: dotnet restore nms-openwire.sln | |
- name: Build solution | |
run: dotnet build nms-openwire.sln --configuration Release --no-restore | |
- name: Run tests | |
run: dotnet test test/nms-openwire-test.csproj --configuration Release --no-build --verbosity normal --logger trx --results-directory TestResults | |
env: | |
ACTIVEMQ_BROKER_URL: tcp://localhost:61616 | |
- name: Upload test results | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: test-results | |
path: TestResults/*.trx |