Smoke Test #16
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: Smoke Test | |
| on: | |
| # Automatic: Run on pending pull requests | |
| pull_request: | |
| branches: | |
| - main | |
| - develop | |
| # Automatic: Run when new commits are pushed to develop or main | |
| push: | |
| paths-ignore: | |
| - '.github/**' | |
| - '.gitignore' | |
| - 'Dockerfile' | |
| - '.dockerignore' | |
| - 'README.md' | |
| branches: | |
| - main | |
| - develop | |
| # Manual: Allow user to manually request this via GitHub UI | |
| workflow_dispatch: | |
| jobs: | |
| smoke-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.9' | |
| - name: Install Python dependencies | |
| run: pip install --user -r requirements.txt | |
| - uses: helm/kind-action@v1 | |
| name: Create kind cluster | |
| with: | |
| config: .kind.with.hostpath.yml | |
| - name: Setup environment | |
| run: | | |
| cat env/backend.json | sed -e 's#"uri": "mongodb://workbench:workbench@workbench-mongodb-svc.workbench.svc.cluster.local:27017/ndslabs?authSource=admin",#"uri": "mongodb://workbench:workbench@localhost:27017/ndslabs?authSource=admin",#' > env/backend.json | |
| cat env/backend.json | |
| - name: Run MongoDB in the background | |
| run: | | |
| kubectl create ns workbench | |
| kubectl run workbench-mongodb-svc -n workbench --image=mongo --restart=Never --expose --port=27017 | |
| kubectl wait pod --for=condition=Ready workbench-mongodb-svc -n workbench | |
| kubectl port-forward svc/workbench-mongodb-svc -n workbench 27017:27017 & | |
| - name: Run Workbench API server in the background | |
| run: | | |
| python ./server.py & | |
| sleep 10s | |
| - name: Test API connections | |
| run: | | |
| sleep 2s | |
| curl --fail --insecure http://localhost:5000/api/v1/version | |
| sleep 2s | |
| curl --fail --insecure http://localhost:5000/backend.json | |
| sleep 2s | |
| curl --fail --insecure http://localhost:5000/frontend.json | |
| sleep 2s | |
| curl --fail --insecure http://localhost:5000/api/v1/services | |
| sleep 2s | |