-
Notifications
You must be signed in to change notification settings - Fork 12
130 lines (107 loc) · 3.37 KB
/
tests.yml
File metadata and controls
130 lines (107 loc) · 3.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: Tests
on:
push:
pull_request:
jobs:
python:
name: Python tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements-dev.txt
- name: Run Python tests
env:
PYTHONPATH: lib/python:cli/python
run: |
python -m pytest
bats:
name: BATS tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install BATS
run: |
sudo apt-get update
sudo apt-get install -y bats
- name: Run BATS tests
run: |
bats \
cli/bash/commands/basectl/tests/*.bats \
lib/bash/file/tests/lib_file.bats \
lib/bash/git/tests/lib_git.bats \
lib/bash/runtime/tests/runtime_bashrc.bats \
lib/bash/std/tests/lib_std.bats \
lib/bash/version/tests/lib_version.bats \
lib/shell/completions/tests/completions.bats \
tests/base_init.bats \
tests/install.bats
integration:
name: Integration tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install dependencies
run: |
python -m venv .integration-venv
.integration-venv/bin/python -m pip install --upgrade pip
.integration-venv/bin/python -m pip install -r requirements-dev.txt
mkdir -p "$HOME/.base.d/base"
python -m venv "$HOME/.base.d/base/.venv"
"$HOME/.base.d/base/.venv/bin/python" -m pip install --upgrade pip
"$HOME/.base.d/base/.venv/bin/python" -m pip install -r requirements-dev.txt
sudo apt-get update
sudo apt-get install -y bats
- name: Run basectl ci smoke check
run: |
./bin/basectl ci check base --format json
- name: Run integration tests
env:
BASE_INTEGRATION_PYTHON: ${{ github.workspace }}/.integration-venv/bin/python
run: |
bats tests/integration/base_workflows.bats
security:
name: Security scanners
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements-dev.txt
sudo apt-get update
sudo apt-get install -y shellcheck
- name: Run Bandit
run: |
bandit -q -r cli/python lib/python -x '*/tests/*' --severity-level medium
- name: Run ShellCheck
run: |
git ls-files -z \
'*.sh' \
'base_init.sh' \
'install.sh' \
'bin/*' \
| xargs -0 shellcheck --severity=error
- name: Run ShellCheck warnings
continue-on-error: true
run: |
git ls-files -z \
'*.sh' \
'base_init.sh' \
'install.sh' \
'bin/*' \
| xargs -0 shellcheck --severity=warning --format=tty