Skip to content

Commit

Permalink
Merge pull request #38 from matomo-org/githubaction
Browse files Browse the repository at this point in the history
Convert travis CI tests to github action
  • Loading branch information
sgiehl authored Dec 9, 2024
2 parents 611a448 + 5008974 commit 9a429a1
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 27 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -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
17 changes: 0 additions & 17 deletions .travis.yml

This file was deleted.

17 changes: 7 additions & 10 deletions tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/")
Expand Down Expand Up @@ -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()

Expand Down

0 comments on commit 9a429a1

Please sign in to comment.