diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 00000000..8bb74382 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,47 @@ +name: Tests + +on: + pull_request: + types: [opened, synchronize] + push: + branches: + - 'master' + +permissions: + actions: read + checks: read + contents: read + deployments: none + issues: read + packages: none + pull-requests: read + repository-projects: none + security-events: none + statuses: none + +jobs: + build: + runs-on: 'ubuntu-latest' + name: Tests + steps: + - uses: actions/checkout@v4 + - name: Checkout Matomo + uses: actions/checkout@v4 + with: + repository: matomo-org/matomo + path: tmp/matomo + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: 3.9 + - name: Install Dependencies + run: | + composer install + yarn install + pip install -r requirements.txt + shell: bash + - name: Run Tests + run: | + shellcheck *.sh + python tests.py + shell: bash \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 1c684fe3..00000000 --- a/.travis.yml +++ /dev/null @@ -1,17 +0,0 @@ -os: linux -dist: focal -language: python -python: - "3.9" - -before_install: - - git clone https://github.com/piwik/piwik-package.git tmp/piwik-package - - composer install - - yarn install - -script: - - 'shellcheck *.sh' - - python tests.py - -jobs: - fast_finish: true diff --git a/tests.py b/tests.py index 286c9576..8fcc406f 100755 --- a/tests.py +++ b/tests.py @@ -33,7 +33,7 @@ searchEnginesFile = Path("vendor/matomo/searchengine-and-social-list/SearchEngines.yml") socialsEnginesFile = Path("vendor/matomo/searchengine-and-social-list/Socials.yml") -build_script_file = Path("tmp/piwik-package/scripts/build-package.sh") +build_script_file = Path("tmp/matomo/.github/scripts/clean-build.sh") src = Path("src/") dist: Path = Path("dist/") @@ -249,22 +249,19 @@ def test_if_there_are_icons_for_all_device_detector_categories( ignore = load_yaml(Path("tests-ignore.yml")) - if "TRAVIS_PULL_REQUEST" not in os.environ or not os.environ["TRAVIS_PULL_REQUEST"]: - test_if_all_icons_are_converted(ignore["ignored_source_files"]) - + test_if_all_icons_are_converted(ignore["ignored_source_files"]) test_if_source_for_images() test_if_all_symlinks_are_valid() test_if_placeholder_icon_exist(ignore["placeholder_icon_filenames"]) test_if_dist_icons_are_square(ignore["ignore_that_icon_isnt_square"]) - travis = "TRAVIS" in os.environ and os.environ["TRAVIS"] # collapse on travis - if travis: - print("travis_fold:start:improvable_icons") - print("improvable icons: (click to expand)") + is_ci = "CI" in os.environ and os.environ["CI"] # collapse on CI + if is_ci: + print("::group::improvable icons: (click to expand)") test_if_there_are_icons_for_all_device_detector_categories(ignore["less_important_device_detector_icons"]) test_if_icons_are_indicated_to_be_improvable() test_if_icons_are_large_enough() - if travis: - print("travis_fold:end:improvable_icons") + if is_ci: + print("::endgroup::") test_if_all_search_and_social_sites_have_an_icon() # test_if_build_script_is_deleting_all_unneeded_files()