build-test #559
This file contains 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-test' | |
on: | |
push: | |
paths-ignore: | |
- '**/*.md' | |
schedule: | |
# Daily 5am australian/brisbane time (7pm UTC) | |
- cron: '0 19 * * *' | |
workflow_dispatch: | |
env: | |
ADMIN_API_KEY: '${{ secrets.OD_IMAGE_ADMIN_API_KEY }}' | |
SA_PASSWORD: '${{ secrets.DB_IMAGE_SA_PASSWORD }}' | |
SERVER_URL: 'http://localhost:8080' | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
services: | |
sqlserver: | |
image: mcr.microsoft.com/mssql/server:2019-latest | |
env: | |
ACCEPT_EULA: Y | |
SA_PASSWORD: ${{ env.SA_PASSWORD }} | |
MSSQL_PID: Developer | |
options: >- | |
--health-cmd "/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P \"$SA_PASSWORD\" -Q \"SELECT 1\" || exit 1" | |
--health-interval 10s | |
--health-timeout 3s | |
--health-retries 10 | |
--health-start-period 10s | |
octopusserver: | |
image: octopusdeploy/octopusdeploy | |
env: | |
ACCEPT_EULA: Y | |
DB_CONNECTION_STRING: 'Server=sqlserver;Database=OctopusDeploy;User Id=sa;Password=${{ env.SA_PASSWORD }};' | |
ADMIN_API_KEY: ${{ env.ADMIN_API_KEY }} | |
ENABLE_USAGE: N | |
OCTOPUS_SERVER_BASE64_LICENSE: ${{ secrets.OCTOPUS_SERVER_BASE64_LICENSE }} | |
ports: | |
- 8080:8080 | |
permissions: | |
statuses: write | |
checks: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Octopus CLI 🐙 | |
uses: OctopusDeploy/install-octopus-cli-action@v1 | |
with: | |
version: '*' | |
- name: Install package dependencies | |
run: npm install | |
- name: Compile and run tests | |
env: | |
OCTOPUS_TEST_URL: ${{ env.SERVER_URL }} | |
OCTOPUS_TEST_API_KEY: ${{ env.ADMIN_API_KEY }} | |
run: npm run all | |
- name: Test Report | |
uses: dorny/test-reporter@v1 | |
if: success() || failure() | |
with: | |
name: JEST Tests | |
path: 'reports/jest-*.xml' | |
reporter: jest-junit | |
- name: Package test report | |
run: | | |
zip -rj MyPackage.1.0.0.zip ./reports | |
zip -rj MyOtherPackage.1.0.0.zip ./reports | |
- name: Push Package to Octopus | |
uses: ./ | |
env: | |
OCTOPUS_URL: ${{ env.SERVER_URL }} | |
OCTOPUS_API_KEY: ${{ env.ADMIN_API_KEY }} | |
OCTOPUS_SPACE: 'Default' | |
with: | |
packages: | | |
MyPackage.1.0.0.zip | |
MyOtherPackage.1.0.0.zip |