diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index cafe464e2..f8bd71441 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -2,12 +2,12 @@ name: "CodeQL" on: push: - branches: [ main ] + branches: [main] pull_request: # The branches below must be a subset of the branches above - branches: [ main ] + branches: [main] schedule: - - cron: '16 20 * * 1' + - cron: "16 20 * * 1" jobs: analyze: @@ -21,37 +21,37 @@ jobs: strategy: fail-fast: false matrix: - language: [ 'python' ] + language: ["python"] steps: - - name: Checkout repository - uses: actions/checkout@v4 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v3 - - # ℹī¸ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 + - name: Checkout repository + uses: actions/checkout@v4 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + # queries: ./path/to/local/query, your-org/your-repo/queries@main + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v3 + + # ℹī¸ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl + + # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language + + #- run: | + # make bootstrap + # make release + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 diff --git a/.github/workflows/functional-3.6.yml b/.github/workflows/functional-3.6.yml index 36d3a305e..27c51e229 100644 --- a/.github/workflows/functional-3.6.yml +++ b/.github/workflows/functional-3.6.yml @@ -2,45 +2,44 @@ name: Functional Legacy on: push: - branches: [ main, 4.2, 3.4 ] + branches: [main, 4.2, 3.4] pull_request: - branches: [ main ] + branches: [main] permissions: contents: read jobs: build: - # runs-on: ubuntu-latest runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - python-version: [ "3.6" ] - os: [ "ubuntu-20.04" ] + python-version: ["3.6"] + os: ["ubuntu-20.04"] steps: - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5.2.0 - with: - python-version: ${{ matrix.python-version }} - - - name: run python version - run: | - python --version - - - name: Install dependencies - run: | - python -m pip install --no-cache-dir --upgrade pip - pip install --no-cache-dir -r requirements.txt - pip install psutil - - - name: change ownership to exa user - run : | - echo "EXABGP_DAEMON_USER=$(whoami)" >> $GITHUB_ENV - - - name: Python 3.6 Coverage - run: | - ./qa/bin/functional-3.6 all + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5.2.0 + with: + python-version: ${{ matrix.python-version }} + + - name: run python version + run: | + python --version + + - name: Install dependencies + run: | + python -m pip install --no-cache-dir --upgrade pip + pip install --no-cache-dir -r requirements.txt + pip install psutil + + - name: change ownership to exa user + run: | + echo "EXABGP_DAEMON_USER=$(whoami)" >> $GITHUB_ENV + + - name: Python 3.6 Coverage + run: | + ./qa/bin/functional-3.6 all diff --git a/.github/workflows/functional-testing.yml b/.github/workflows/functional-testing.yml index 0329615ae..d5f726e50 100644 --- a/.github/workflows/functional-testing.yml +++ b/.github/workflows/functional-testing.yml @@ -2,49 +2,48 @@ name: Functional Testing on: push: - branches: [ main, 4.2, 3.4 ] + branches: [main, 4.2, 3.4] pull_request: - branches: [ main ] + branches: [main] permissions: contents: read jobs: build: - # runs-on: ubuntu-latest runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ] - os: [ "ubuntu-latest" ] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + os: ["ubuntu-latest"] steps: - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5.2.0 - with: - python-version: ${{ matrix.python-version }} - - - name: run python version - run: | - python --version - - - name: Install dependencies - run: | - python -m pip install --no-cache-dir --upgrade pip - pip install --no-cache-dir -r requirements.txt - pip install psutil - - - name: Configuration - run: | - ./qa/bin/functional parsing - - - name: Functional - run: | - ./qa/bin/functional encoding - - - name: Decoding - run: | - ./qa/bin/functional decoding + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5.2.0 + with: + python-version: ${{ matrix.python-version }} + + - name: run python version + run: | + python --version + + - name: Install dependencies + run: | + python -m pip install --no-cache-dir --upgrade pip + pip install --no-cache-dir -r requirements.txt + pip install psutil + + - name: Configuration + run: | + ./qa/bin/functional parsing + + - name: Functional + run: | + ./qa/bin/functional encoding + + - name: Decoding + run: | + ./qa/bin/functional decoding diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 6d1ee1832..21bb2462a 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -2,38 +2,37 @@ name: Linting on: push: - branches: [ main, 4.2, 3.4 ] + branches: [main, 4.2, 3.4] pull_request: - branches: [ main ] + branches: [main] permissions: contents: read jobs: build: - # runs-on: ubuntu-latest runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - python-version: [ "3.12" ] - os: [ "ubuntu-latest" ] + python-version: ["3.12"] + os: ["ubuntu-latest"] steps: - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5.2.0 - with: - python-version: ${{ matrix.python-version }} + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5.2.0 + with: + python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - pip install psutil - pip install flake8 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install psutil + pip install flake8 - - name: flake8 - run: | - flake8 . --exclude src/exabgp/vendoring/ --exclude build/ --exclude site-packages --count --select=E9,F63,F7,F82 --show-source --statistics + - name: flake8 + run: | + flake8 . --exclude src/exabgp/vendoring/ --exclude build/ --exclude site-packages --count --select=E9,F63,F7,F82 --show-source --statistics diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0d975c490..32c490e33 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,7 +3,7 @@ name: Publish packages on: push: tags: - - 'v*' + - "v*" permissions: contents: read @@ -22,7 +22,6 @@ jobs: uses: actions/setup-python@v5.2.0 with: python-version: 3.8 - # - name: Build # run: | # make init build @@ -31,4 +30,4 @@ jobs: # uses: pypa/gh-action-pypi-publish@master # with: # user: __token__ -# password: ${{ secrets.GH_ACTIONS_EXABGP }} \ No newline at end of file +# password: ${{ secrets.GH_ACTIONS_EXABGP }} diff --git a/.github/workflows/unit-testing.yml b/.github/workflows/unit-testing.yml index 03dd0a517..f330f6932 100644 --- a/.github/workflows/unit-testing.yml +++ b/.github/workflows/unit-testing.yml @@ -5,37 +5,36 @@ name: Unit Testing on: push: - branches: [ main, 4.2, 3.4 ] + branches: [main, 4.2, 3.4] pull_request: - branches: [ main ] + branches: [main] permissions: contents: read jobs: build: - # runs-on: ubuntu-latest runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11", "3.12" ] - os: [ "ubuntu-latest" ] + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] + os: ["ubuntu-latest"] steps: - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5.2.0 - with: - python-version: ${{ matrix.python-version }} - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - pip install pytest pytest-cov - - - name: pytest - run: | - env PYTHONPATH=src exabgp_log_enable=false pytest --cov --cov-reset ./tests/*_test.py + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5.2.0 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install pytest pytest-cov + + - name: pytest + run: | + env PYTHONPATH=src exabgp_log_enable=false pytest --cov --cov-reset ./tests/*_test.py