diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2021-05-09 12:34:32 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2021-05-15 15:08:00 +0300 |
commit | e0f03c99f8cd9db8ab5a97fd5656042a160f8955 (patch) | |
tree | fb6707a4bfc10865220139592647339983cb5a07 /.github/workflows/test.yml | |
download | clang-format-e0f03c99f8cd9db8ab5a97fd5656042a160f8955.tar.gz clang-format-e0f03c99f8cd9db8ab5a97fd5656042a160f8955.zip |
initial commit
Diffstat (limited to '.github/workflows/test.yml')
-rw-r--r-- | .github/workflows/test.yml | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..37492f2 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,56 @@ +name: Test + +on: + push: + pull_request: + schedule: + # Weekly, at 5:45 AM on Friday (somewhat randomly chosen). + - cron: '45 5 * * 5' + workflow_dispatch: + +jobs: + old_and_new: + strategy: + matrix: + os: [ubuntu-latest] + version: [10, 11] + style: [file, Chromium] + include: + - {style: file, exclude: test/chromium.cpp} + - {style: Chromium, exclude: test/file.cpp} + + runs-on: '${{ matrix.os }}' + + name: '${{ matrix.os }} / ${{ matrix.version }} / ${{ matrix.style }}' + + defaults: + run: + shell: pwsh + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: clang-format (success) + uses: ./ + with: + version: '${{ matrix.version }}' + style: '${{ matrix.style }}' + exclude: '${{ matrix.exclude }}' + + - id: diff + name: clang-format (fail) + uses: ./ + with: + version: '${{ matrix.version }}' + style: '${{ matrix.style }}' + continue-on-error: true + + - name: Verify diff + run: | + $output = '${{ steps.diff.outputs.diff }}' + $basename = Split-Path '${{ matrix.exclude }}' -Leaf + $original = "$basename (original)" + $formatted = "$basename (formatted)" + $output.Contains($original) -or $(throw "Diff should contain: $original") + $output.Contains($formatted) -or $(throw "Diff should contain: $formatted") |