Skip to content

[ADMINAPI-1049] - Create documentation 2.2.1, github action to create openapi #77

[ADMINAPI-1049] - Create documentation 2.2.1, github action to create openapi

[ADMINAPI-1049] - Create documentation 2.2.1, github action to create openapi #77

# SPDX-License-Identifier: Apache-2.0
# Licensed to the Ed-Fi Alliance under one or more agreements.
# The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0.
# See the LICENSE and NOTICES files in the project root for more information.
name: Admin API Single Tenant E2E Tests + ODS 7 + Pgsql
on:
push:
branches: [main]
schedule:
- cron: "0 5 * * 1"
workflow_dispatch:
pull_request:
branches: [main]
env:
JIRA_ACCESS_TOKEN: ${{ secrets.JIRA_ACCESS_TOKEN }}
ADMIN_API_VERSION: "1.2"
PROJECT_ID: "13401"
CYCLE_NAME: "Automation Cycle"
TASK_NAME: "API Automation Task"
FOLDER_NAME: "API Automation Run"
RESULTS_FILE: "test-xml-results"
permissions: read-all
jobs:
run-e2e-tests:
defaults:
run:
working-directory: ./Application/EdFi.Ods.AdminApi/
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Copy application folder to docker context
run: |
mkdir ../../Docker/Application
cp -r ../EdFi.Ods.AdminApi ../../Docker/Application
- name: Copy nuget config to docker context
run: cp ../NuGet.Config ../../Docker/Application
- name: Update certificates
run: cp -r ../../eng/test-certs/ssl ../../Docker/Settings
- name: Run Admin API
run: |
docker compose \
-f '../../Docker/Compose/pgsql/SingleTenant/compose-build-dev.yml' \
--env-file './E2E Tests/gh-action-setup/.automation_pgsql.env' \
up -d
- name: Verify containers are running
run: |
chmod +x './E2E Tests/gh-action-setup/inspect.sh'
'./E2E Tests/gh-action-setup/inspect.sh' adminapi
- name: Setup node
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: "16"
- name: Install Tools
run: npm install -g [email protected] [email protected] [email protected]
- name: Combine Collections
run: |
postman-combine-collections -f './E2E Tests/Admin API E2E 2.0 -*.postman_collection.json' \
-n 'Admin API E2E 2.0' \
-o './E2E Tests/Admin-API-Full-Collection.json'
- name: Run tests
run: |
newman run './E2E Tests/Admin-API-Full-Collection.json' \
-e './E2E Tests/Admin API Docker-single-pgsql.postman_environment.json' \
-r cli,junit,htmlextra \
--reporter-htmlextra-title 'AdminAPI - 2.0' \
--reporter-htmlextra-export './report-html/results.html' \
--reporter-junit-export ./reports/report.xml \
-k
- name: Get Docker logs
if: failure()
run: |
mkdir docker-logs
docker logs ed-fi-db-admin-adminapi > docker-logs/ed-fi-db-admin-adminapi.log
docker logs adminapi > docker-logs/adminapi.log
- name: Upload Docker logs
if: failure()
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
with:
name: docker-logs
path: Application/EdFi.Ods.AdminApi/docker-logs/
retention-days: 5
- name: Upload Html results
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
if: success() || failure()
with:
name: test-html-results
path: Application/EdFi.Ods.AdminApi/report-html/results.html
retention-days: 5
- name: Upload xml results
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
if: success() || failure()
with:
name: test-xml-results
path: Application/EdFi.Ods.AdminApi/reports/report.xml
retention-days: 5
report:
defaults:
run:
shell: pwsh
needs:
- run-e2e-tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Download artifacts
uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 #v4.1.1
# Commented code until Token is renewed
# - name: Send report to Zephyr
# run: |
# $parameters = @{
# cycleName = '${{ env.CYCLE_NAME }}'
# taskName = '${{ env.TASK_NAME }}'
# folderName = '${{ env.FOLDER_NAME }}'
# }
# .\eng\send-test-results.ps1 `
# -PersonalAccessToken ${{ env.JIRA_ACCESS_TOKEN }} `
# -ProjectId ${{ env.PROJECT_ID }} `
# -AdminApiVersion '${{ env.ADMIN_API_VERSION }}' `
# -ResultsFilePath '${{ env.RESULTS_FILE }}/report.xml' `
# -ConfigParams $parameters