|
7 | 7 | runs-on: ${{ matrix.os }} |
8 | 8 | strategy: |
9 | 9 | matrix: |
10 | | - os: |
11 | | - - ubuntu-latest |
12 | | - python: [3.9, 3.13] |
13 | | - splunk-version: |
14 | | - - "9.3" |
15 | | - - "9.4" |
16 | | - - "latest" |
17 | | - include: |
18 | | - - os: ubuntu-22.04 |
19 | | - python: 3.9 |
20 | | - splunk-version: "9.3" |
21 | | - - os: ubuntu-22.04 |
22 | | - python: 3.9 |
23 | | - splunk-version: "9.4" |
24 | | - - os: ubuntu-22.04 |
25 | | - python: 3.9 |
26 | | - splunk-version: "latest" |
| 10 | + os: [ubuntu-latest] |
| 11 | + python-version: [3.9, 3.13] |
| 12 | + splunk-version: ["9.3", "9.4", "latest"] |
| 13 | + |
27 | 14 | fail-fast: false |
28 | 15 |
|
29 | 16 | steps: |
30 | 17 | - name: Checkout repo |
31 | 18 | uses: actions/checkout@v4 |
32 | | - - name: Set up .env |
| 19 | + - name: Set up environment variables |
33 | 20 | run: cp ./.env.template ./.env |
34 | | - - name: Run docker-compose with Splunk v${{ matrix.splunk-version }} |
| 21 | + - name: Run docker-compose with Splunk ${{ matrix.splunk-version }} |
35 | 22 | run: SPLUNK_VERSION=${{ matrix.splunk-version }} docker compose up -d |
36 | | - - name: Restore cached `venv` and `.tox` |
37 | | - id: restore-venv-cache |
38 | | - uses: actions/cache/restore@v4 |
| 23 | + - name: Set up Python |
| 24 | + uses: actions/setup-python@v4 |
39 | 25 | with: |
40 | | - path: | |
41 | | - ./venv |
42 | | - ./.tox |
43 | | - key: ${{ runner.os }}-3.9-venv-${{ hashFiles('**/pyproject.toml') }} |
44 | | - - name: Build venv if there's no cache |
45 | | - if: steps.restore-venv-cache.outputs.cache-hit != 'true' |
46 | | - run: | |
47 | | - python -m venv ./venv |
48 | | - - name: Install package |
49 | | - run: ./venv/bin/python -m pip install . |
| 26 | + python-version: ${{ matrix.python-version }} |
| 27 | + - name: Install Python dependencies to venv |
| 28 | + run: pip install . |
50 | 29 | - name: Run test suite |
51 | | - run: ./venv/bin/python -m tox -e py |
52 | | - - name: Cache venv and .tox |
53 | | - uses: actions/cache/save@v4 |
54 | | - if: steps.restore-venv-cache.outputs.cache-hit != 'true' |
55 | | - with: |
56 | | - path: | |
57 | | - ./venv |
58 | | - ./.tox |
59 | | - key: ${{ steps.restore-venv-cache.outputs.cache-primary-key }} |
| 30 | + run: python -m tox -e py |
60 | 31 | # [BJ] I'll obviously uncomment this step after I finish fiddling |
61 | 32 | # fossa-scan: |
62 | 33 | # uses: splunk/oss-scanning-public/.github/workflows/oss-scan.yml@main |
|
0 commit comments