Skip to content

Commit

Permalink
add github action integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
sni committed Mar 21, 2024
1 parent af6accd commit c3fdf3d
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 14 deletions.
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,10 @@ updates:
pull-request-branch-name:
separator: "-"
open-pull-requests-limit: 10

- package-ecosystem: gomod
directory: "/"
schedule:
interval: weekly
time: '10:00'
open-pull-requests-limit: 10
58 changes: 44 additions & 14 deletions .github/workflows/citest.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
name: citest
name: Builds
on:
push:
pull_request:
schedule:
- cron: '30 4 * * 1'

# set go version for all steps
env:
GOVERSION: 1.22.x

jobs:
test:
strategy:
fail-fast: false
matrix:
go-version:
- 1.22.x
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
steps:
- uses: abbbi/github-actions-tune@v1
- uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- uses: actions/checkout@v3
go-version: ${{ env.GOVERSION }}
- run: make clean
- run: make citest
- run: make
Expand All @@ -29,3 +25,37 @@ jobs:
name: check_nsc_web-go${{ matrix.go-version }}
path: check_nsc_web
- run: make clean

integration:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GOVERSION }}
- run: |
echo "Testing with ${{ env.GOVERSION }}"
go work init
go work use .
$Env:GOWORK = "off"
go mod vendor
$Env:GOWORK = ""
# build check_nsc_web
go build -o ./check_nsc_web.exe cmd/check_nsc_web/main.go
# install nscp
Invoke-WebRequest -UseBasicParsing -Uri https://github.com/mickem/nscp/releases/download/0.5.2.35/NSCP-0.5.2.35-x64.msi -OutFile NSCP-0.5.2.35-x64.msi
Start-Process msiexec -Wait -ArgumentList '/i NSCP-0.5.2.35-x64.msi /qn CONF_WEB=1 NSCLIENT_PWD=test'
# activate version check
& 'C:\Program Files\NSClient++\nscp.exe' settings --activate-module CheckNSCP
# make sure it is started
net stop nscp
net start nscp
# check if connection works
.\check_nsc_web.exe -k -p test -u https://127.0.0.1:8443 ; if ($LASTEXITCODE -ne 0) { exit 1 }
.\check_nsc_web.exe -k -p test -u https://127.0.0.1:8443 check_nscp_version ; if ($LASTEXITCODE -ne 0) { exit 1 }

0 comments on commit c3fdf3d

Please sign in to comment.