Skip to content

Commit

Permalink
Add a test and run in GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
benmatselby committed Oct 15, 2023
1 parent 82e5163 commit 488cf62
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: CI

on: [pull_request]

jobs:
run-tests:
strategy:
fail-fast: false
matrix:
st-version: [3, 4]
os: ["ubuntu-latest", "macOS-latest", "windows-latest"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: SublimeText/UnitTesting/actions/setup@v1
with:
# Details: https://github.com/SublimeText/UnitTesting/blob/master/actions/setup/action.yaml#L19
package-name: Phpcs
sublime-text-version: ${{ matrix.st-version }}
- uses: SublimeText/UnitTesting/actions/run-tests@v1
with:
# Details: https://github.com/SublimeText/UnitTesting/blob/master/actions/setup/action.yaml#L19
package-name: Phpcs
21 changes: 21 additions & 0 deletions tests/test_phpcs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import os
import re
import sys
import sublime


from unittesting import (
AWAIT_WORKER,
DeferrableTestCase,
)
from Phpcs.phpcs import Sniffer


class TestDiffViewInternalFunctions(DeferrableTestCase):
def test_something(self):
php_path = "/bin/php"
s = sublime.load_settings("phpcs.sublime-settings")
s.set("phpcs_php_prefix_path", php_path)

args = Sniffer().get_executable_args()
self.assertIn(php_path, args)

0 comments on commit 488cf62

Please sign in to comment.