add trivvy and fix vulnerability #342
Workflow file for this run
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: test-with-wis2box | |
on: [ push, pull_request ] | |
jobs: | |
main: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
name: setup Python | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
working-directory: docker_compose_test | |
run: | | |
python3 -m pip install --upgrade pip | |
pip3 install -r requirements.txt | |
- name: Docker Compose up -d --build | |
working-directory: docker_compose_test | |
run: | |
docker compose up -d --build | |
- name: Wait for service to be ready | |
run: sleep 30 | |
- name: publish datasets | |
working-directory: docker_compose_test | |
run: | | |
docker exec -t wis2box-api-test-wis2box-management wis2box dataset publish /data/wis2box/metadata/discovery/synop-test.yml | |
docker exec -t wis2box-api-test-wis2box-management wis2box dataset publish /data/wis2box/metadata/discovery/csv-test.yml | |
docker exec -t wis2box-api-test-wis2box-management wis2box dataset publish /data/wis2box/metadata/discovery/bufr-test.yml | |
docker exec -t wis2box-api-test-wis2box-management wis2box dataset publish /data/wis2box/metadata/discovery/cap-test.yml | |
- name: publish stations and associate to topic | |
working-directory: docker_compose_test | |
run: | | |
docker exec -t wis2box-api-test-wis2box-management wis2box metadata station publish-collection -p /data/wis2box/metadata/station/station_list.csv -th origin/a/wis2/synop-test/data/core/weather/surface-based-observations/synop | |
docker exec -t wis2box-api-test-wis2box-management wis2box metadata station add-topic --wsi 0-20000-0-15015 origin/a/wis2/csv-test/data/core/weather/surface-based-observations/synop | |
docker exec -t wis2box-api-test-wis2box-management wis2box metadata station add-topic --wsi 0-20000-0-16344 origin/a/wis2/bufr-test/data/core/weather/surface-based-observations/synop | |
curl http://localhost:4343/oapi/collections/stations/items | |
- name: Check status code API | |
working-directory: docker_compose_test | |
run: | | |
status_code=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:4343/oapi) | |
if [[ $status_code -ne 200 ]]; then | |
echo "Request failed with status code $status_code" | |
exit 1 | |
fi | |
- name: run integration tests ⚙️ | |
working-directory: docker_compose_test | |
run: | | |
pytest -s tests/integration | |
- name: failed tests 🚩 | |
working-directory: docker_compose_test | |
if: ${{ failure() }} | |
run: | | |
docker compose logs |