Skip to content

Commit

Permalink
Add Github Actions support (cherry picked from master)
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisBrunner committed Oct 3, 2024
1 parent e0243e6 commit d4eccea
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: /
schedule:
interval: weekly
3 changes: 3 additions & 0 deletions .github/ubuntu-24.04-expected.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
none/tests/log-track-fds (stderr)
none/tests/track-fds-exec-children (stderr)
none/tests/xml-track-fds (stderr)
71 changes: 71 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Build

on: [push]

env:
TEST_FOLDER: .github/test

jobs:
build_various_platforms:
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04]

runs-on: ${{ matrix.os }}

name: Build and Test on ${{matrix.os}}

steps:
- name: install dependencies (MacOS)
run: brew update && brew install automake
if: ${{ matrix.os != 'ubuntu-24.04' }}
- name: install dependencies (Linux)
run: sudo apt-get update && sudo apt-get install libc6-dbg gdb
if: ${{ matrix.os == 'ubuntu-24.04' }}
- name: checkout project
uses: actions/checkout@v1
- name: calculate short SHA
id: sha
run: echo "short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: autogen.sh
run: ./autogen.sh
- name: configure
run: ./configure
- name: build
run: make
- name: try ls -l
run: ./vg-in-place ls -l
- name: build regression tests
run: make check
- name: create artifacts folder
run: mkdir -p ${{ env.TEST_FOLDER }}/outputs
- name: build tests
run: make check
- name: run regression tests
run: make regtest | tee raw-results.txt
- name: process results
if: always()
run: awk '/^== [0-9]+ tests, .* ==$/{flag=1;next}/^$/{flag=0}flag' < raw-results.txt > ${{ env.TEST_FOLDER }}/results.txt
- name: copy failing test outputs
if: always()
run: cat ${{ env.TEST_FOLDER }}/results.txt | cut -f 1 -d' ' | xargs -L1 -I % sh -c 'cp %.*.diff* ${{ env.TEST_FOLDER }}/outputs/'
- name: calculate difference between tests
if: always()
uses: LouisBrunner/diff-action@v0.2.0
with:
old: .github/${{ matrix.os }}-expected.txt
new: ${{ env.TEST_FOLDER }}/results.txt
mode: deletion
tolerance: same
output: ${{ env.TEST_FOLDER }}/results.diff
token: ${{ secrets.GITHUB_TOKEN }}
title: ${{ matrix.os }}
notify_check: true
notify_issue: true
- name: upload artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-${{ steps.sha.outputs.short }}-${{ matrix.os }}
path: ${{ env.TEST_FOLDER }}/
1 change: 1 addition & 0 deletions tests/check_headers_and_includes
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ my %tool_dirs = (
my %dirs_to_ignore = (
".deps" => 1,
".git" => 1,
".github" => 1, # Only for valgrind-macos
".in_place" => 1,
"Inst" => 1, # the nightly scripts creates this
"VEX" => 1,
Expand Down
5 changes: 4 additions & 1 deletion tests/vg_regtest.in
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,10 @@ sub test_one_dir($$)
# Nb: Don't prepend a '/' to the base directory
my $full_dir = $prev_dirs . ($prev_dirs eq "" ? "" : "/") . $dir;
print TSLOG scalar localtime, " entering $full_dir\n";
my $dashes = "-" x (50 - length $full_dir);
my $dashes = "";
if (length $full_dir <= 50) {
$dashes = "-" x (50 - length $full_dir);
}

my @fs = glob "*";
my $found_tests = (0 != (grep { $_ =~ /\.vgtest$/ } @fs));
Expand Down

0 comments on commit d4eccea

Please sign in to comment.