Skip to content

Commit

Permalink
[TEST] Run full twister build on push
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanosio committed Mar 5, 2024
1 parent 10d8709 commit 56bf864
Showing 1 changed file with 75 additions and 75 deletions.
150 changes: 75 additions & 75 deletions .github/workflows/twister.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ jobs:
fi
size=${TWISTER_NODES}
elif [ "${{github.event_name}}" = "push" ]; then
subset="[$(seq -s',' 1 ${PUSH_MATRIX_SIZE})]"
size=${MATRIX_SIZE}
elif [ "${{github.event_name}}" = "schedule" -a "${{github.repository}}" = "zephyrproject-rtos/zephyr" ]; then
# subset="[$(seq -s',' 1 ${PUSH_MATRIX_SIZE})]"
# size=${MATRIX_SIZE}
# elif [ "${{github.event_name}}" = "schedule" -a "${{github.repository}}" = "zephyrproject-rtos/zephyr" ]; then
subset="[$(seq -s',' 1 ${DAILY_MATRIX_SIZE})]"
size=${DAILY_MATRIX_SIZE}
else
Expand Down Expand Up @@ -220,18 +220,18 @@ jobs:
ccache -p
ccache -z -s -vv
- if: github.event_name == 'push'
name: Run Tests with Twister (Push)
run: |
export ZEPHYR_BASE=${PWD}
export ZEPHYR_TOOLCHAIN_VARIANT=zephyr
./scripts/twister --subset ${{matrix.subset}}/${{ strategy.job-total }} ${TWISTER_COMMON} ${PUSH_OPTIONS}
if [ "${{matrix.subset}}" = "1" ]; then
./scripts/zephyr_module.py --twister-out module_tests.args
if [ -s module_tests.args ]; then
./scripts/twister +module_tests.args --outdir module_tests ${TWISTER_COMMON} ${PUSH_OPTIONS}
fi
fi
# - if: github.event_name == 'push'
# name: Run Tests with Twister (Push)
# run: |
# export ZEPHYR_BASE=${PWD}
# export ZEPHYR_TOOLCHAIN_VARIANT=zephyr
# ./scripts/twister --subset ${{matrix.subset}}/${{ strategy.job-total }} ${TWISTER_COMMON} ${PUSH_OPTIONS}
# if [ "${{matrix.subset}}" = "1" ]; then
# ./scripts/zephyr_module.py --twister-out module_tests.args
# if [ -s module_tests.args ]; then
# ./scripts/twister +module_tests.args --outdir module_tests ${TWISTER_COMMON} ${PUSH_OPTIONS}
# fi
# fi

- if: github.event_name == 'pull_request_target'
name: Run Tests with Twister (Pull Request)
Expand All @@ -248,7 +248,7 @@ jobs:
fi
fi
- if: github.event_name == 'schedule'
- if: github.event_name == 'push'
name: Run Tests with Twister (Daily)
run: |
export ZEPHYR_BASE=${PWD}
Expand Down Expand Up @@ -296,65 +296,65 @@ jobs:
path: |
frozen-requirements.txt
twister-test-results:
name: "Publish Unit Tests Results"
env:
ELASTICSEARCH_KEY: ${{ secrets.ELASTICSEARCH_KEY }}
ELASTICSEARCH_SERVER: "https://elasticsearch.zephyrproject.io:443"
needs: twister-build
runs-on: ubuntu-22.04
# the build-and-test job might be skipped, we don't need to run this job then
if: success() || failure()

steps:
# Needed for opensearch and upload script
- if: github.event_name == 'push' || github.event_name == 'schedule'
name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false

- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: artifacts

- if: github.event_name == 'push' || github.event_name == 'schedule'
name: Upload to opensearch
run: |
pip3 install elasticsearch
# set run date on upload to get consistent and unified data across the matrix.
run_date=`date --iso-8601=minutes`
if [ "${{github.event_name}}" = "push" ]; then
python3 ./scripts/ci/upload_test_results_es.py -r ${run_date} \
--index zephyr-main-ci-push-1 artifacts/*/*/twister.json
elif [ "${{github.event_name}}" = "schedule" ]; then
python3 ./scripts/ci/upload_test_results_es.py -r ${run_date} \
--index zephyr-main-ci-weekly-1 artifacts/*/*/twister.json
fi
- name: Merge Test Results
run: |
pip3 install junitparser junit2html
junitparser merge artifacts/*/*/twister.xml junit.xml
junit2html junit.xml junit.html
- name: Upload Unit Test Results in HTML
if: always()
uses: actions/upload-artifact@v4
with:
name: HTML Unit Test Results
if-no-files-found: ignore
path: |
junit.html
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
check_name: Unit Test Results
files: "**/twister.xml"
comment_mode: off
# twister-test-results:
# name: "Publish Unit Tests Results"
# env:
# ELASTICSEARCH_KEY: ${{ secrets.ELASTICSEARCH_KEY }}
# ELASTICSEARCH_SERVER: "https://elasticsearch.zephyrproject.io:443"
# needs: twister-build
# runs-on: ubuntu-22.04
# # the build-and-test job might be skipped, we don't need to run this job then
# if: success() || failure()

# steps:
# # Needed for opensearch and upload script
# - if: github.event_name == 'push' || github.event_name == 'schedule'
# name: Checkout
# uses: actions/checkout@v4
# with:
# fetch-depth: 0
# persist-credentials: false

# - name: Download Artifacts
# uses: actions/download-artifact@v4
# with:
# path: artifacts

# - if: github.event_name == 'push' || github.event_name == 'schedule'
# name: Upload to opensearch
# run: |
# pip3 install elasticsearch
# # set run date on upload to get consistent and unified data across the matrix.
# run_date=`date --iso-8601=minutes`
# if [ "${{github.event_name}}" = "push" ]; then
# python3 ./scripts/ci/upload_test_results_es.py -r ${run_date} \
# --index zephyr-main-ci-push-1 artifacts/*/*/twister.json
# elif [ "${{github.event_name}}" = "schedule" ]; then
# python3 ./scripts/ci/upload_test_results_es.py -r ${run_date} \
# --index zephyr-main-ci-weekly-1 artifacts/*/*/twister.json
# fi

# - name: Merge Test Results
# run: |
# pip3 install junitparser junit2html
# junitparser merge artifacts/*/*/twister.xml junit.xml
# junit2html junit.xml junit.html

# - name: Upload Unit Test Results in HTML
# if: always()
# uses: actions/upload-artifact@v4
# with:
# name: HTML Unit Test Results
# if-no-files-found: ignore
# path: |
# junit.html

# - name: Publish Unit Test Results
# uses: EnricoMi/publish-unit-test-result-action@v2
# with:
# check_name: Unit Test Results
# files: "**/twister.xml"
# comment_mode: off
twister-status-check:
if: always()
name: "Check Twister Status"
Expand Down

0 comments on commit 56bf864

Please sign in to comment.