Skip to content

Bump actions/checkout from 3.5.2 to 4.0.0 (#36) #71

Bump actions/checkout from 3.5.2 to 4.0.0 (#36)

Bump actions/checkout from 3.5.2 to 4.0.0 (#36) #71

Workflow file for this run

name: test-push
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1
with:
python-version: 3.8
architecture: x64
- run: pip install -r requirements.txt
- run: pip install flake8
- name: Lint with flake8
run: flake8 nca_rest_server --count --max-complexity=15 --max-line-length=127 --statistics
rest-api:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1
with:
python-version: 3.8
architecture: x64
- run: pip install -r requirements.txt
- run: |
python -m nca_rest_server &
NCA_PID=$!
while true; do # wait until REST server becomes responsive
curl_status=0
curl localhost:5000 || curl_status=$?
[ $curl_status -gt 0 ] || break
sleep 1
done
curl -X POST -H Content-Type:application/json -d @tests/basic/ns_list.json localhost:5000/namespace_list
curl -X POST -H Content-Type:application/json -d @tests/basic/pods_list.json localhost:5000/pod_list
curl -X POST -H Content-Type:application/json -d @tests/basic/testcase1-networkpolicy1.json localhost:5000/policy_sets
curl -X POST -H Content-Type:application/json -d @tests/basic/testcase2-networkpolicies.json localhost:5000/policy_sets
curl localhost:5000/policy_sets/set_0/findings -o testcase1_findings.json
diff testcase1_findings.json tests/basic/testcase1_expected_findings.json
curl localhost:5000/policy_sets/set_1/findings -o testcase2_findings.json
diff testcase2_findings.json tests/basic/testcase2_expected_findings.json
kill $NCA_PID