Skip to content

Commit 8564d9a

Browse files
committed
gha test 1
1 parent f6ad318 commit 8564d9a

File tree

1 file changed

+70
-0
lines changed

1 file changed

+70
-0
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Run Tests with Linode CLI and JSON Spec
2+
3+
on:
4+
push:
5+
branches:
6+
- development
7+
pull_request:
8+
branches:
9+
- development
10+
workflow_dispatch:
11+
inputs:
12+
sha:
13+
description: 'Specify commit hash to test. This value is mandatory to ensure the tests run against a specific commit'
14+
required: true
15+
default: ''
16+
pull_request_number:
17+
description: 'Specify pull request number associated with the commit. Optional, but recommended when providing a commit hash (sha)'
18+
required: false
19+
test_suite:
20+
description: "Specify test suite to run from the 'tests/integration' directory. Examples: 'cli', 'domains', 'events', etc. If not provided, all suites are executed"
21+
required: false
22+
run_long_tests:
23+
description: "Select 'True' to include long-running tests (e.g., database provisioning, server rebuilds). Defaults to 'False'"
24+
required: false
25+
type: choice
26+
options:
27+
- "True"
28+
- "False"
29+
default: "False"
30+
31+
jobs:
32+
test-linode-cli:
33+
runs-on: ubuntu-latest
34+
if: github.event_name == 'workflow_dispatch' && inputs.sha != '' || github.event_name == 'push' || github.event_name == 'pull_request'
35+
36+
steps:
37+
- name: Checkout Current Repository (JSON Spec)
38+
uses: actions/checkout@v4
39+
with:
40+
fetch-depth: 0
41+
submodules: 'recursive'
42+
ref: ${{ inputs.sha || github.ref }}
43+
path: json-spec
44+
45+
- name: Checkout Linode CLI (dev branch)
46+
uses: actions/checkout@v4
47+
with:
48+
repository: linode/linode-cli
49+
ref: dev
50+
path: linode-cli
51+
52+
- name: Set up Python
53+
uses: actions/setup-python@v5
54+
with:
55+
python-version: "3.9"
56+
57+
- name: Get JSON Spec Path
58+
run: echo "JSON_SPEC_PATH=$(pwd)/json-spec/spec.json" >> $GITHUB_ENV
59+
60+
- name: Install Linode CLI dependencies
61+
run: |
62+
cd linode-cli
63+
SPEC=$JSON_SPEC_PATH make install
64+
65+
- name: Run CLI E2E Tests
66+
run: |
67+
cd linode-cli
68+
make test-int TEST_SUITE="${{ inputs.test_suite }}" RUN_LONG_TESTS="${{ inputs.run_long_tests }}"
69+
env:
70+
LINODE_CLI_TOKEN: ${{ env.LINODE_CLI_TOKEN }}

0 commit comments

Comments
 (0)