Skip to content

Commit c8c17d0

Browse files
Merge pull request #717 from linode/dev
Release v5.56.1
2 parents f23417c + 634488f commit c8c17d0

File tree

17 files changed

+248
-188
lines changed

17 files changed

+248
-188
lines changed
Lines changed: 33 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,51 @@
1-
name: Unit Tests
1+
name: Continuous Integration
22
on:
33
workflow_dispatch: null
44
push:
55
pull_request:
66
jobs:
7+
docker-build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
- name: Build the Docker image
12+
run: docker build . --file Dockerfile --tag linode/cli:$(date +%s) --build-arg="github_token=$GITHUB_TOKEN"
13+
env:
14+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15+
16+
lint:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: checkout repo
20+
uses: actions/checkout@v4
21+
22+
- name: setup python 3
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: '3.x'
26+
27+
- name: install dependencies
28+
run: make install
29+
30+
- name: run linter
31+
run: make lint
32+
733
unit-tests-on-ubuntu:
834
runs-on: ubuntu-latest
935
strategy:
1036
matrix:
11-
python-version: [ '3.9','3.10','3.11', '3.12' ]
37+
python-version: [ "3.9","3.10","3.11", "3.12", "3.13" ]
1238
steps:
1339
- name: Clone Repository
1440
uses: actions/checkout@v4
1541

16-
- name: Update system packages
17-
run: sudo apt-get update -y
18-
1942
- name: Setup Python
2043
uses: actions/setup-python@v5
2144
with:
2245
python-version: ${{ matrix.python-version }}
2346

24-
- name: Install Python wheel
25-
run: pip install wheel boto3
26-
27-
- name: Update cert
28-
run: pip install certifi -U
29-
30-
- name: Install deps
31-
run: pip install .[dev]
47+
- name: Install Python dependencies
48+
run: pip install -U certifi
3249

3350
- name: Install Package
3451
run: make install
@@ -47,16 +64,10 @@ jobs:
4764
- name: Setup Python
4865
uses: actions/setup-python@v5
4966
with:
50-
python-version: '3.x'
51-
52-
- name: Install Python wheel
53-
run: pip install wheel boto3
54-
55-
- name: Update cert
56-
run: pip install certifi -U
67+
python-version: "3.x"
5768

58-
- name: Install deps
59-
run: pip install .[dev]
69+
- name: Install Python dependencies
70+
run: pip install -U certifi
6071

6172
- name: Install Package
6273
shell: pwsh

.github/workflows/codeql.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: "CodeQL Advanced"
2+
3+
on:
4+
push:
5+
branches: [ "dev", "main" ]
6+
pull_request:
7+
branches: [ "dev", "main" ]
8+
schedule:
9+
- cron: "0 13 * * 5"
10+
11+
jobs:
12+
analyze:
13+
name: Analyze (${{ matrix.language }})
14+
runs-on: ubuntu-latest
15+
permissions:
16+
security-events: write
17+
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
include:
22+
- language: python
23+
build-mode: none
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v4
27+
28+
- name: Initialize CodeQL
29+
uses: github/codeql-action/init@v3
30+
with:
31+
languages: ${{ matrix.language }}
32+
build-mode: ${{ matrix.build-mode }}
33+
34+
- name: Perform CodeQL Analysis
35+
uses: github/codeql-action/analyze@v3
36+
with:
37+
category: "/language:${{matrix.language}}"
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: 'Dependency review'
2+
on:
3+
pull_request:
4+
branches: [ "dev", "main", "proj/*" ]
5+
6+
permissions:
7+
contents: read
8+
pull-requests: write
9+
10+
jobs:
11+
dependency-review:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: 'Checkout repository'
15+
uses: actions/checkout@v4
16+
- name: 'Dependency Review'
17+
uses: actions/dependency-review-action@v4
18+
with:
19+
comment-summary-in-pr: on-failure

.github/workflows/docker-build.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

.github/workflows/e2e-suite-windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
env:
7474
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7575

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

.github/workflows/e2e-suite.yml

Lines changed: 62 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,36 @@ on:
44
workflow_dispatch:
55
inputs:
66
use_minimal_test_account:
7-
description: 'Use minimal test account'
7+
description: 'Indicate whether to use a minimal test account with limited resources for testing. Defaults to "false"'
88
required: false
99
default: 'false'
10-
module:
11-
description: "The module from 'test/integration' to the target to be tested, e.g. 'cli, domains, events, etc'"
10+
test_suite:
11+
description: "Specify test suite to run from the 'tests/integration' directory. Examples: 'cli', 'domains', 'events', etc. If not provided, all suites are executed"
1212
required: false
1313
run_long_tests:
14-
description: "Select True to run long tests, e.g. database, rebuild, etc"
14+
description: "Select 'True' to include long-running tests (e.g., database provisioning, server rebuilds). Defaults to 'False'"
1515
required: false
1616
type: choice
1717
options:
1818
- "True"
1919
- "False"
2020
default: "False"
2121
sha:
22-
description: 'The hash value of the commit.'
22+
description: 'Specify commit hash to test. This value is mandatory to ensure the tests run against a specific commit'
2323
required: true
2424
default: ''
2525
pull_request_number:
26-
description: 'The number of the PR. Ensure sha value is provided'
26+
description: 'Specify pull request number associated with the commit. Optional, but recommended when providing a commit hash (sha)'
2727
required: false
2828
openapi_spec_url:
29-
description: 'URL of the OpenAPI spec to use for the tests'
29+
description: 'Specify URL of the OpenAPI specification file to use for testing. Useful for validating tests against a specific API version or custom specification'
3030
required: false
3131
default: ''
3232
python-version:
33-
description: 'Specify Python version to use'
33+
description: 'Specify the Python version to use for running tests. Leave empty to use the default Python version configured in the environment'
3434
required: false
3535
run-eol-python-version:
36-
description: 'Run EOL python version?'
36+
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'
3737
required: false
3838
default: 'false'
3939
type: choice
@@ -124,24 +124,18 @@ jobs:
124124
run: |
125125
timestamp=$(date +'%Y%m%d%H%M')
126126
report_filename="${timestamp}_cli_test_report.xml"
127-
make testint TEST_ARGS="--junitxml=${report_filename}" MODULE="${{ inputs.module }}" RUN_LONG_TESTS="${{ inputs.run_long_tests }}"
127+
make test-int TEST_ARGS="--junitxml=${report_filename}" TEST_SUITE="${{ inputs.test_suite }}" RUN_LONG_TESTS="${{ inputs.run_long_tests }}"
128128
env:
129129
LINODE_CLI_TOKEN: ${{ env.LINODE_CLI_TOKEN }}
130130

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

146140
- name: Update PR Check Run
147141
uses: actions/github-script@v7
@@ -237,6 +231,51 @@ jobs:
237231
env:
238232
LINODE_CLI_TOKEN: ${{ env.LINODE_CLI_TOKEN }}
239233

234+
process-upload-report:
235+
runs-on: ubuntu-latest
236+
needs: [integration_tests]
237+
if: always() && github.repository == 'linode/linode-cli' # Run even if integration tests fail and only on main repository
238+
239+
steps:
240+
- name: Checkout code
241+
uses: actions/checkout@v4
242+
with:
243+
fetch-depth: 0
244+
submodules: 'recursive'
245+
246+
- name: Download test report
247+
uses: actions/download-artifact@v4
248+
with:
249+
name: test-report-file
250+
251+
- name: Set up Python
252+
uses: actions/setup-python@v5
253+
with:
254+
python-version: '3.x'
255+
256+
- name: Install Python dependencies
257+
run: pip3 install requests wheel boto3==1.35.99
258+
259+
- name: Set release version env
260+
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
261+
262+
263+
- name: Add variables and upload test results
264+
if: always()
265+
run: |
266+
filename=$(ls | grep -E '^[0-9]{12}_cli_test_report\.xml$')
267+
python3 e2e_scripts/tod_scripts/xml_to_obj_storage/scripts/add_gha_info_to_xml.py \
268+
--branch_name "${GITHUB_REF#refs/*/}" \
269+
--gha_run_id "$GITHUB_RUN_ID" \
270+
--gha_run_number "$GITHUB_RUN_NUMBER" \
271+
--xmlfile "${filename}"
272+
sync
273+
python3 e2e_scripts/tod_scripts/xml_to_obj_storage/scripts/xml_to_obj.py "${filename}"
274+
env:
275+
LINODE_CLI_OBJ_ACCESS_KEY: ${{ secrets.LINODE_CLI_OBJ_ACCESS_KEY }}
276+
LINODE_CLI_OBJ_SECRET_KEY: ${{ secrets.LINODE_CLI_OBJ_SECRET_KEY }}
277+
278+
240279
notify-slack:
241280
runs-on: ubuntu-latest
242281
needs: [integration_tests]

.github/workflows/nightly-smoke-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
- name: Run smoke tests
4141
id: smoke_tests
4242
run: |
43-
make smoketest
43+
make test-smoke
4444
env:
4545
LINODE_CLI_TOKEN: ${{ secrets.LINODE_TOKEN }}
4646

.github/workflows/publish-pypi.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

.github/workflows/pull-request.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)