Re-enable backend tests. #562
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: build-and-test | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| workflow_dispatch: # Allows manual running | |
| jobs: | |
| build_and_test: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 80 | |
| steps: | |
| - uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # check-out the repository | |
| - name: Show disk free and top repo files | |
| run: | | |
| df -h | |
| sudo du -sh /home/runner/* || true | |
| echo "--- top large files in repo (top 40) ---" | |
| sudo du -ah --max-depth=2 . | sort -rh | head -n 40 || true | |
| - name: Estimate and show docker build context size | |
| run: | | |
| git ls-files > /tmp/gitfiles.txt | |
| echo "Files in context: $(wc -l /tmp/gitfiles.txt)" | |
| tar -cf - -T /tmp/gitfiles.txt | wc -c | awk '{print $1 " bytes"}' | |
| - name: Build Docker image | |
| run: | | |
| docker build . -f Dockerfile -t mguim | |
| sudo apt-get install wget | |
| - name: Run microgridup_gen_mgs._tests | |
| run: | | |
| docker run mguim -c "import microgridup_gen_mgs; microgridup_gen_mgs._tests()" | |
| - name: Run microgridup_design._tests | |
| run: | | |
| docker run mguim -c "import microgridup_design; microgridup_design._tests()" | |
| - name: Run microgridup_hosting_cap._tests | |
| run: | | |
| docker run mguim -c "import microgridup_hosting_cap; microgridup_hosting_cap._tests()" | |
| - name: Run microgridup_control._tests | |
| run: | | |
| docker run mguim -c "import microgridup_control; microgridup_control._tests()" | |
| - name: Run microgridup_resilience._tests | |
| run: | | |
| docker run mguim -c "import microgridup_resilience; microgridup_resilience._tests()" | |
| - name: Run microgridup_gui._tests | |
| run: | | |
| docker run mguim -c "import microgridup_gui; microgridup_gui._tests()" | |
| - name: Run tests_backend_full.py | |
| run: | | |
| docker run mguim tests_backend_full.py | |
| - name: Test microgridup_gui.py server runs and returns successful response | |
| run: | | |
| docker run -d -p 5000:5000 --name mgucont mguim | |
| sleep 10 | |
| wget localhost:5000 |