mirror of https://github.com/borgbase/vorta
Reduce number of tests. By @bigtedde (#1780)
This commit is contained in:
parent
e5c9b2245a
commit
567a3546ae
|
@ -0,0 +1,30 @@
|
||||||
|
event_name="$1"
|
||||||
|
branch_name="$2"
|
||||||
|
|
||||||
|
if [[ "$event_name" == "workflow_dispatch" ]] || [[ "$branch_name" == "master" ]]; then
|
||||||
|
echo '{
|
||||||
|
"python-version": ["3.8", "3.9", "3.10", "3.11"],
|
||||||
|
"os": ["ubuntu-latest", "macos-latest"],
|
||||||
|
"borg-version": ["1.2.4"]
|
||||||
|
}' | jq -c . > matrix-unit.json
|
||||||
|
|
||||||
|
echo '{
|
||||||
|
"python-version": ["3.8", "3.9", "3.10", "3.11"],
|
||||||
|
"os": ["ubuntu-latest", "macos-latest"],
|
||||||
|
"borg-version": ["1.1.18", "1.2.2", "1.2.4", "2.0.0b5"],
|
||||||
|
"exclude": [{"borg-version": "2.0.0b5", "python-version": "3.8"}]
|
||||||
|
}' | jq -c . > matrix-integration.json
|
||||||
|
|
||||||
|
elif [[ "$event_name" == "push" ]] || [[ "$event_name" == "pull_request" ]]; then
|
||||||
|
echo '{
|
||||||
|
"python-version": ["3.8", "3.9", "3.10", "3.11"],
|
||||||
|
"os": ["ubuntu-latest", "macos-latest"],
|
||||||
|
"borg-version": ["1.2.4"]
|
||||||
|
}' | jq -c . > matrix-unit.json
|
||||||
|
|
||||||
|
echo '{
|
||||||
|
"python-version": ["3.10"],
|
||||||
|
"os": ["ubuntu-latest"],
|
||||||
|
"borg-version": ["1.2.4"]
|
||||||
|
}' | jq -c . > matrix-integration.json
|
||||||
|
fi
|
|
@ -26,16 +26,36 @@ jobs:
|
||||||
shell: bash
|
shell: bash
|
||||||
run: make lint
|
run: make lint
|
||||||
|
|
||||||
|
prepare-matrix:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
matrix-unit: ${{ steps.set-matrix-unit.outputs.matrix }}
|
||||||
|
matrix-integration: ${{ steps.set-matrix-integration.outputs.matrix }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Give execute permission to script
|
||||||
|
run: chmod +x ./.github/scripts/generate-matrix.sh
|
||||||
|
|
||||||
|
- name: Generate matrices
|
||||||
|
run: |
|
||||||
|
./.github/scripts/generate-matrix.sh "${{ github.event_name }}" "${GITHUB_REF##refs/heads/}"
|
||||||
|
|
||||||
|
- name: Set matrix for unit tests
|
||||||
|
id: set-matrix-unit
|
||||||
|
run: echo "matrix=$(cat matrix-unit.json)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Set matrix for integration tests
|
||||||
|
id: set-matrix-integration
|
||||||
|
run: echo "matrix=$(cat matrix-integration.json)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
test-unit:
|
test-unit:
|
||||||
|
needs: prepare-matrix
|
||||||
timeout-minutes: 20
|
timeout-minutes: 20
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
matrix: ${{fromJson(needs.prepare-matrix.outputs.matrix-unit)}}
|
||||||
matrix:
|
|
||||||
python-version: ["3.8", "3.9", "3.10", "3.11"]
|
|
||||||
os: [ubuntu-latest, macos-latest]
|
|
||||||
borg-version: ["1.2.4"]
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
@ -51,7 +71,7 @@ jobs:
|
||||||
|
|
||||||
- name: Setup tmate session
|
- name: Setup tmate session
|
||||||
uses: mxschmitt/action-tmate@v3
|
uses: mxschmitt/action-tmate@v3
|
||||||
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }}
|
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true' }}
|
||||||
|
|
||||||
- name: Run Unit Tests with pytest (Linux)
|
- name: Run Unit Tests with pytest (Linux)
|
||||||
if: runner.os == 'Linux'
|
if: runner.os == 'Linux'
|
||||||
|
@ -78,18 +98,12 @@ jobs:
|
||||||
env_vars: OS, python
|
env_vars: OS, python
|
||||||
|
|
||||||
test-integration:
|
test-integration:
|
||||||
|
needs: prepare-matrix
|
||||||
timeout-minutes: 20
|
timeout-minutes: 20
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
matrix: ${{fromJson(needs.prepare-matrix.outputs.matrix-integration)}}
|
||||||
matrix:
|
|
||||||
python-version: ["3.8", "3.9", "3.10", "3.11"]
|
|
||||||
os: [ubuntu-latest, macos-latest]
|
|
||||||
borg-version: ["1.1.18", "1.2.2", "1.2.4", "2.0.0b5"]
|
|
||||||
exclude:
|
|
||||||
- borg-version: "2.0.0b5"
|
|
||||||
python-version: "3.8"
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
@ -105,7 +119,7 @@ jobs:
|
||||||
|
|
||||||
- name: Setup tmate session
|
- name: Setup tmate session
|
||||||
uses: mxschmitt/action-tmate@v3
|
uses: mxschmitt/action-tmate@v3
|
||||||
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }}
|
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true'}}
|
||||||
|
|
||||||
- name: Run Integration Tests with pytest (Linux)
|
- name: Run Integration Tests with pytest (Linux)
|
||||||
if: runner.os == 'Linux'
|
if: runner.os == 'Linux'
|
||||||
|
|
Loading…
Reference in New Issue