Skip to content

Commit

Permalink
common: integrate all PMem workflows
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Michalski <[email protected]>
  • Loading branch information
janekmi committed Aug 30, 2023
1 parent a07d4d7 commit a19198a
Show file tree
Hide file tree
Showing 10 changed files with 247 additions and 229 deletions.
41 changes: 41 additions & 0 deletions .github/actions/pmem_test_prepare/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: PMEM test prepare
description: PMDK testing procedure for self-hosted runners equipped with PMEM
inputs:
ndctl_enable:
description: Build with RAS support
required: false
default: y
fault_injection:
description: Build with the fault injection capability
required: false
default: '0'
runs:
using: composite
steps:
- run: echo 'WORKDIR=utils/gha-runners' >> "$GITHUB_ENV"
shell: bash
- run: |
echo '::group::Get system information'
$WORKDIR/get-system-info.sh
echo '::endgroup::'
shell: bash
- env:
FAULT_INJECTION: ${{ inputs.fault_injection }}
NDCTL_ENABLE: ${{ inputs.ndctl_enable }}
run: |
echo '::group::Build'
$WORKDIR/build-pmdk.sh
echo '::endgroup::'
shell: bash

- run: |
echo '::group::Create testconfig files'
$WORKDIR/../create-testconfig.sh
for testconfig in src/test/testconfig.sh src/test/testconfig.py; do
echo "$testconfig"
cat $testconfig
echo
done
echo '::endgroup::'
shell: bash
56 changes: 0 additions & 56 deletions .github/actions/pmem_test_procedure/action.yml

This file was deleted.

56 changes: 56 additions & 0 deletions .github/actions/pmem_test_run/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: PMEM test procedure
description: PMDK testing procedure for self-hosted runners equipped with PMEM
inputs:
test_script:
description: |
'sh' for RUNTESTS.sh, 'py' for RUNTESTS.py. The default is 'both'.
required: false
default: 'both'
build:
description: Build type to be tested.
required: true
test_type:
description: Test type to be run. Supported values are short, medium, long, check (short+medium), all (short+medium+long).
required: false
default: 'all'
test_label:
description: Limit testing to tests that have the given label assigned.
required: false
default: ''
force_enable:
description: Force the use of a specific Valgrind tool.
required: false
default: ''
runs:
using: composite
steps:
# Run tests employing the Bash-based test framework.
- if: inputs.test_script != 'py' # run for 'sh' and 'both'
working-directory: src/test
env:
TEST_LABEL: ${{ inputs.test_label }}
# TEST_BUILD and TEST_TYPE environment variables are overwritten by
# testconfig.sh hence the respective values have to be provided as
# command parameters (-b and -t respectively).
run: |
echo '::group::Tests Bash'
cmd="./RUNTESTS.sh -b ${{ inputs.build }} -t ${{ inputs.test_type }}"
[ "${{ inputs.force_enable }}" != '' ] &&
cmd="$cmd --force-enable ${{ inputs.force_enable }}"
bash -c "$cmd"
echo '::endgroup::'
shell: bash

# Run tests employing the Python-based test framework.
- if: inputs.test_script != 'sh' # run for 'py' and 'both'
working-directory: src/test
run: |
echo '::group::Tests Python'
cmd="./RUNTESTS.py -b ${{ inputs.build }} -t ${{ inputs.test_type }}"
[ "${{ inputs.test_label }}" != '' ] &&
cmd="$cmd --test-label ${{ inputs.test_label }}"
[ "${{ inputs.force_enable }}" != '' ] &&
cmd="$cmd --force-enable ${{ inputs.force_enable }}"
bash -c "$cmd"
echo '::endgroup::'
shell: bash
73 changes: 0 additions & 73 deletions .github/workflows/pmem_check.yml

This file was deleted.

41 changes: 0 additions & 41 deletions .github/workflows/pmem_long.yml

This file was deleted.

42 changes: 42 additions & 0 deletions .github/workflows/pmem_test_matrix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# A common matrix for running tests on PMEM.
#
# This workflow is run on 'self-hosted' runners.
name: PMEM test matrix

on:
workflow_call:
inputs:
force_enable:
required: true
type: string
timeout_minutes:
required: false
type: number
default: 360 # The jobs.<job_id>.timeout-minutes default.

jobs:
job:
name: ${{ matrix.force_enable }}, ${{ matrix.test_script }}, ${{ matrix.os }}, ${{ matrix.build }}
if: github.repository == 'pmem/pmdk'
runs-on: [self-hosted, "${{ matrix.os }}"]
timeout-minutes: ${{ inputs.timeout_minutes }}
strategy:
fail-fast: false
matrix:
force_enable: ${{ fromJSON(inputs.force_enable) }}
test_script: [sh, py]
os: [rhel, opensuse]
build: [debug, nondebug]

steps:
- uses: actions/checkout@v3

- name: Test prepare
uses: ./.github/actions/pmem_test_prepare

- name: Test run
uses: ./.github/actions/pmem_test_run
with:
test_script: ${{ matrix.test_script }}
build: ${{ matrix.build }}
force_enable: ${{ matrix.force_enable }}
Loading

0 comments on commit a19198a

Please sign in to comment.