From 2c88fad9eae17da10893bec9e995f237baa528c3 Mon Sep 17 00:00:00 2001 From: Ben Selby Date: Sun, 15 Oct 2023 10:09:02 +0100 Subject: [PATCH] Add a test and run in GitHub Actions --- .github/workflows/ci.yml | 21 +++++++++++++++++++++ tests/test_phpcs.py | 21 +++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 tests/test_phpcs.py diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..06423ba --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,21 @@ +name: CI + +on: [push, 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: + sublime-text-version: ${{ matrix.st-version }} + - uses: SublimeText/UnitTesting/actions/run-tests@v1 + # with: + # coverage: true + # - uses: codecov/codecov-action@v3 \ No newline at end of file diff --git a/tests/test_phpcs.py b/tests/test_phpcs.py new file mode 100644 index 0000000..588ce4e --- /dev/null +++ b/tests/test_phpcs.py @@ -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)