Skip to content

Commit

Permalink
Merge pull request #717 from linode/dev
Browse files Browse the repository at this point in the history
Release v5.56.1
  • Loading branch information
lgarber-akamai authored Jan 30, 2025
2 parents f23417c + 634488f commit c8c17d0
Show file tree
Hide file tree
Showing 17 changed files with 248 additions and 188 deletions.
55 changes: 33 additions & 22 deletions .github/workflows/unit-tests.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,51 @@
name: Unit Tests
name: Continuous Integration
on:
workflow_dispatch: null
push:
pull_request:
jobs:
docker-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build the Docker image
run: docker build . --file Dockerfile --tag linode/cli:$(date +%s) --build-arg="github_token=$GITHUB_TOKEN"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

lint:
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v4

- name: setup python 3
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: install dependencies
run: make install

- name: run linter
run: make lint

unit-tests-on-ubuntu:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.9','3.10','3.11', '3.12' ]
python-version: [ "3.9","3.10","3.11", "3.12", "3.13" ]
steps:
- name: Clone Repository
uses: actions/checkout@v4

- name: Update system packages
run: sudo apt-get update -y

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install Python wheel
run: pip install wheel boto3

- name: Update cert
run: pip install certifi -U

- name: Install deps
run: pip install .[dev]
- name: Install Python dependencies
run: pip install -U certifi

- name: Install Package
run: make install
Expand All @@ -47,16 +64,10 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Install Python wheel
run: pip install wheel boto3

- name: Update cert
run: pip install certifi -U
python-version: "3.x"

- name: Install deps
run: pip install .[dev]
- name: Install Python dependencies
run: pip install -U certifi

- name: Install Package
shell: pwsh
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: "CodeQL Advanced"

on:
push:
branches: [ "dev", "main" ]
pull_request:
branches: [ "dev", "main" ]
schedule:
- cron: "0 13 * * 5"

jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-latest
permissions:
security-events: write

strategy:
fail-fast: false
matrix:
include:
- language: python
build-mode: none
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
19 changes: 19 additions & 0 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: 'Dependency review'
on:
pull_request:
branches: [ "dev", "main", "proj/*" ]

permissions:
contents: read
pull-requests: write

jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- name: 'Checkout repository'
uses: actions/checkout@v4
- name: 'Dependency Review'
uses: actions/dependency-review-action@v4
with:
comment-summary-in-pr: on-failure
20 changes: 0 additions & 20 deletions .github/workflows/docker-build.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/e2e-suite-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- run: make MODULE="${{ inputs.module }}" RUN_LONG_TESTS="${{ inputs.run_long_tests }}" testint
- run: make MODULE="${{ inputs.module }}" RUN_LONG_TESTS="${{ inputs.run_long_tests }}" test-int
env:
LINODE_CLI_TOKEN: ${{ secrets.LINODE_TOKEN_2 }}

Expand Down
85 changes: 62 additions & 23 deletions .github/workflows/e2e-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,36 @@ on:
workflow_dispatch:
inputs:
use_minimal_test_account:
description: 'Use minimal test account'
description: 'Indicate whether to use a minimal test account with limited resources for testing. Defaults to "false"'
required: false
default: 'false'
module:
description: "The module from 'test/integration' to the target to be tested, e.g. 'cli, domains, events, etc'"
test_suite:
description: "Specify test suite to run from the 'tests/integration' directory. Examples: 'cli', 'domains', 'events', etc. If not provided, all suites are executed"
required: false
run_long_tests:
description: "Select True to run long tests, e.g. database, rebuild, etc"
description: "Select 'True' to include long-running tests (e.g., database provisioning, server rebuilds). Defaults to 'False'"
required: false
type: choice
options:
- "True"
- "False"
default: "False"
sha:
description: 'The hash value of the commit.'
description: 'Specify commit hash to test. This value is mandatory to ensure the tests run against a specific commit'
required: true
default: ''
pull_request_number:
description: 'The number of the PR. Ensure sha value is provided'
description: 'Specify pull request number associated with the commit. Optional, but recommended when providing a commit hash (sha)'
required: false
openapi_spec_url:
description: 'URL of the OpenAPI spec to use for the tests'
description: 'Specify URL of the OpenAPI specification file to use for testing. Useful for validating tests against a specific API version or custom specification'
required: false
default: ''
python-version:
description: 'Specify Python version to use'
description: 'Specify the Python version to use for running tests. Leave empty to use the default Python version configured in the environment'
required: false
run-eol-python-version:
description: 'Run EOL python version?'
description: 'Indicates whether to run tests using an End-of-Life (EOL) Python version. Defaults to "false". Choose "true" to include tests for deprecated Python versions'
required: false
default: 'false'
type: choice
Expand Down Expand Up @@ -124,24 +124,18 @@ jobs:
run: |
timestamp=$(date +'%Y%m%d%H%M')
report_filename="${timestamp}_cli_test_report.xml"
make testint TEST_ARGS="--junitxml=${report_filename}" MODULE="${{ inputs.module }}" RUN_LONG_TESTS="${{ inputs.run_long_tests }}"
make test-int TEST_ARGS="--junitxml=${report_filename}" TEST_SUITE="${{ inputs.test_suite }}" RUN_LONG_TESTS="${{ inputs.run_long_tests }}"
env:
LINODE_CLI_TOKEN: ${{ env.LINODE_CLI_TOKEN }}

- name: Upload test results
- name: Upload Test Report as Artifact
if: always()
run: |
filename=$(ls | grep -E '^[0-9]{12}_cli_test_report\.xml$')
python3 e2e_scripts/tod_scripts/xml_to_obj_storage/scripts/add_gha_info_to_xml.py \
--branch_name "${GITHUB_REF#refs/*/}" \
--gha_run_id "$GITHUB_RUN_ID" \
--gha_run_number "$GITHUB_RUN_NUMBER" \
--xmlfile "${filename}"
sync
python3 e2e_scripts/tod_scripts/xml_to_obj_storage/scripts/xml_to_obj.py "${filename}"
env:
LINODE_CLI_OBJ_ACCESS_KEY: ${{ secrets.LINODE_CLI_OBJ_ACCESS_KEY }}
LINODE_CLI_OBJ_SECRET_KEY: ${{ secrets.LINODE_CLI_OBJ_SECRET_KEY }}
uses: actions/upload-artifact@v4
with:
name: test-report-file
if-no-files-found: ignore
path: '*.xml'
retention-days: 1

- name: Update PR Check Run
uses: actions/github-script@v7
Expand Down Expand Up @@ -237,6 +231,51 @@ jobs:
env:
LINODE_CLI_TOKEN: ${{ env.LINODE_CLI_TOKEN }}

process-upload-report:
runs-on: ubuntu-latest
needs: [integration_tests]
if: always() && github.repository == 'linode/linode-cli' # Run even if integration tests fail and only on main repository

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: 'recursive'

- name: Download test report
uses: actions/download-artifact@v4
with:
name: test-report-file

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Install Python dependencies
run: pip3 install requests wheel boto3==1.35.99

- name: Set release version env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV


- name: Add variables and upload test results
if: always()
run: |
filename=$(ls | grep -E '^[0-9]{12}_cli_test_report\.xml$')
python3 e2e_scripts/tod_scripts/xml_to_obj_storage/scripts/add_gha_info_to_xml.py \
--branch_name "${GITHUB_REF#refs/*/}" \
--gha_run_id "$GITHUB_RUN_ID" \
--gha_run_number "$GITHUB_RUN_NUMBER" \
--xmlfile "${filename}"
sync
python3 e2e_scripts/tod_scripts/xml_to_obj_storage/scripts/xml_to_obj.py "${filename}"
env:
LINODE_CLI_OBJ_ACCESS_KEY: ${{ secrets.LINODE_CLI_OBJ_ACCESS_KEY }}
LINODE_CLI_OBJ_SECRET_KEY: ${{ secrets.LINODE_CLI_OBJ_SECRET_KEY }}


notify-slack:
runs-on: ubuntu-latest
needs: [integration_tests]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly-smoke-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- name: Run smoke tests
id: smoke_tests
run: |
make smoketest
make test-smoke
env:
LINODE_CLI_TOKEN: ${{ secrets.LINODE_TOKEN }}

Expand Down
39 changes: 0 additions & 39 deletions .github/workflows/publish-pypi.yml

This file was deleted.

22 changes: 0 additions & 22 deletions .github/workflows/pull-request.yml

This file was deleted.

Loading

0 comments on commit c8c17d0

Please sign in to comment.