fix unconnected test #10
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: CI | |
| on: [push, pull_request] | |
| jobs: | |
| test: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.9", "3.12"] | |
| os: [ ubuntu-22.04 ] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install uv and set the python version | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| enable-cache: true # caches uv’s package cache between runs | |
| - name: Fix sudoers and verify uv available | |
| run: | | |
| sudo sed -i -e '/secure_path/d' /etc/sudoers | |
| sudo -E uv --version | |
| - name: Install munet project | |
| run: | | |
| uv sync --locked --all-extras --dev | |
| - name: install Qemu | |
| run: | | |
| uname -a | |
| sudo apt-get update -y | |
| sudo apt-get install -y cloud-utils qemu-system-x86 | |
| - name: Lint the project | |
| run: make ci-lint | |
| - name: Verify json schema is up-to-date | |
| run: | | |
| make munet/munet-schema.json | |
| bash -c '[[ -z "$(git status -s --untracked=no)" ]]' | |
| - name: Run YANG tests | |
| run: make test-validate | |
| - name: Make sure podman image is present | |
| run: sudo podman pull docker.io/labn/docker-ci-test:20.04 | |
| - name: Expose the environment | |
| run: | | |
| uname -a || true | |
| cat /etc/os-release || true | |
| cat /proc/meminfo || true | |
| cat /proc/cpuinfo || true | |
| - name: Run main tests | |
| run: | | |
| make FETCH_GH_TOKEN="${{ secrets.FETCH_GH_TOKEN }}" test | |
| - name: Upload coverage report | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| verbose: true | |
| files: ./coverage.xml | |
| # fail_ci_if_error: false | |
| - name: Collect test logs | |
| if: ${{ always() }} | |
| run: | | |
| sudo find /tmp/unet-test -type s -exec rm {} + | |
| mkdir -p test-logs | |
| sudo tar -C /tmp/unet-test -cf - . | tar -C test-logs -xf - | |
| tar -cjf test-logs.tar.bz2 test-logs | |
| - name: Archive test logs tarball | |
| if: ${{ always() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-logs-tar-${{ matrix.python-version }} | |
| path: test-logs.tar.bz2 |