Skip to content

Commit

Permalink
test: Refactor testing to use check.sh
Browse files Browse the repository at this point in the history
Also adds matrix of supported versions to CI check.

Related to: #33
  • Loading branch information
jidicula committed Jan 15, 2022
1 parent 88be589 commit 24a713b
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 47 deletions.
17 changes: 0 additions & 17 deletions .github/workflows/dockerimage.yml

This file was deleted.

36 changes: 36 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Test

on:
push:
branches:
- main
pull_request:
branches:
- main

defaults:
run:
shell: bash

jobs:
test:
name: clang-format-${{ matrix.version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version:
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
steps:
- uses: actions/[email protected]
- name: Build and test the Docker image
run: test/test.sh ${{ matrix.version }}
30 changes: 0 additions & 30 deletions test/docker-run-test.sh

This file was deleted.

21 changes: 21 additions & 0 deletions test/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash

FALLBACK_STYLE="llvm"
EXCLUDE_REGEX="capital"
CLANG_FORMAT_VERSION="$1"

# should succeed
"$GITHUB_WORKSPACE"/check.sh "$CLANG_FORMAT_VERSION" "$GITHUB_WORKSPACE/test/known_pass" "$FALLBACK_STYLE" "$EXCLUDE_REGEX"
docker_status="$?"
if [[ "$docker_status" != "0" ]]; then
echo "files that should succeed have failed!"
exit 1
fi

# should fail
"$GITHUB_WORKSPACE"/check.sh "$CLANG_FORMAT_VERSION" "$GITHUB_WORKSPACE/test/known_fail" "$FALLBACK_STYLE" "$EXCLUDE_REGEX"
docker_status="$?"
if [[ "$docker_status" == "0" ]]; then
echo "files that should fail have succeeded!"
exit 2
fi

0 comments on commit 24a713b

Please sign in to comment.