Skip to content

Commit

Permalink
Add GUIX regression tests. (#68)
Browse files Browse the repository at this point in the history
Add GUIX regression tests.
  • Loading branch information
ting-ms authored Nov 16, 2023
1 parent 354445b commit 0e6fdbf
Show file tree
Hide file tree
Showing 8,392 changed files with 8,892,662 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
109 changes: 109 additions & 0 deletions .github/workflows/regression_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# This is a basic workflow that is manually triggered

name: regression_test

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
workflow_dispatch:
pull_request:
branches: [ master ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "linux_job"
run_tests:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

permissions:
pages: write
id-token: write
contents: read
issues: read
checks: write
pull-requests: write

# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Check out the repository
uses: actions/checkout@v4
with:
submodules: true

- name: Install softwares
run: ./scripts/install.sh

- name: Build GUIX
run: ./scripts/build.sh

- name: Test GUIX
run: ./scripts/test.sh

- name: Publish Test Results
uses: EnricoMi/[email protected]
if: always()
with:
files: |
./test/guix_test/cmake/build/*/*.xml
- name: Upload Test Results
if: success() || failure()
uses: actions/[email protected]
with:
name: test_reports_GUIX
path: |
./test/guix_test/cmake/build/*.txt
./test/guix_test/cmake/build/*/Testing/**/*.xml
./test/guix_test/cmake/build/**/regression/output_files/*.bin
- name: Configure GitHub Pages
uses: actions/[email protected]

- name: Upload GitHub Pages artifact
uses: actions/[email protected]
with:
path: ./test/guix_test/cmake/coverage_report/default_build_coverage

- name: Deploy GitHub Pages site
id: deployment
uses: actions/[email protected]

- name: Generate Code Coverage Results Summary
uses: irongut/[email protected]
with:
filename: ./test/guix_test/cmake/coverage_report/default_build_coverage.xml
format: markdown
badge: true
hide_complexity: true
output: file

- name: Write Code Coverage Report URL
run: |
cat code-coverage-results.md > code-coverage-summary.md
echo -e "\n" >> code-coverage-summary.md
echo '[Open Coverage Report](${{ steps.deployment.outputs.page_url }})' >> code-coverage-summary.md
echo "## Coverage Report" >> $GITHUB_STEP_SUMMARY
cat code-coverage-summary.md >> $GITHUB_STEP_SUMMARY
- name: Create CheckRun for Code Coverage
uses: LouisBrunner/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: Code Coverage
conclusion: ${{ job.status }}
output: |
{"summary":"Coverage Report"}
output_text_description_file: code-coverage-summary.md

- name: Add Code Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request'
with:
append: true
path: code-coverage-summary.md

2 changes: 2 additions & 0 deletions scripts/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
$(dirname `realpath $0`)/../test/guix_test/cmake/run.sh build all
28 changes: 28 additions & 0 deletions scripts/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash
#

# Remove large folder
rm -rf /opt/hostedtoolcache

# Install necessary softwares for Ubuntu.

sudo apt-get update
sudo apt-get install -y \
gcc-multilib \
git \
g++ \
python3-pip \
ninja-build \
unifdef \
p7zip-full \
tofrodos \
gawk \
software-properties-common

wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | sudo apt-key add -
CODENAME=$(lsb_release -c | cut -f2 -d':' | sed 's/\t//')
apt-add-repository "deb https://apt.kitware.com/ubuntu/ $CODENAME main"

python3 -m pip install --upgrade pip
pip3 install gcovr==4.1
pip install --upgrade cmake
2 changes: 2 additions & 0 deletions scripts/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
CTEST_PARALLEL_LEVEL=4 $(dirname `realpath $0`)/../test/guix_test/cmake/run.sh test all
Loading

0 comments on commit 0e6fdbf

Please sign in to comment.