Skip to content

Commit

Permalink
Merge pull request #13 from antistatique/feature/ci-tests-runner
Browse files Browse the repository at this point in the history
  • Loading branch information
WengerK authored Jul 12, 2023
2 parents 4b08ec4 + 9054397 commit a35cbac
Show file tree
Hide file tree
Showing 13 changed files with 88 additions and 5,498 deletions.
2 changes: 1 addition & 1 deletion .coveralls.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
service_name: travis-ci
service_name: github-actions

# for php-coveralls
coverage_clover: build/logs/clover.xml
40 changes: 19 additions & 21 deletions .github/workflows/code-styles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v1
uses: shivammathur/setup-php@v2
with:
php-version: '7.3'
php-version: '8.0'
extensions: mbstring, intl, gd, xml, dom, json, fileinfo, curl, zip, iconv
tools: php-cs-fixer, cs2pr
- uses: actions/checkout@master
- uses: actions/checkout@v2
- run: composer install --prefer-dist
- run: ./vendor/bin/php-cs-fixer fix --dry-run --format=checkstyle | cs2pr

Expand All @@ -21,11 +21,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v1
uses: shivammathur/setup-php@v2
with:
php-version: '7.3'
php-version: '8.1'
extensions: mbstring, intl, gd, xml, dom, json, fileinfo, curl, zip, iconv
- uses: actions/checkout@master
- uses: actions/checkout@v2
- run: composer install --prefer-dist
- run: ./vendor/bin/phpmd ./ text ./phpmd.xml --suffixes php,inc,test --exclude vendor,bin,tests

Expand All @@ -34,11 +34,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v1
uses: shivammathur/setup-php@v2
with:
php-version: '7.3'
php-version: '8.1'
extensions: mbstring, intl, gd, xml, dom, json, fileinfo, curl, zip, iconv
- uses: actions/checkout@master
- uses: actions/checkout@v2
- run: composer install --prefer-dist
- run: ./vendor/bin/phpcpd ./ --suffix .php --suffix .inc --suffix .test --exclude vendor --exclude bin --exclude tests

Expand All @@ -47,12 +47,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v1
uses: shivammathur/setup-php@v2
with:
php-version: '7.3'
php-version: '8.1'
extensions: mbstring, intl, gd, xml, dom, json, fileinfo, curl, zip, iconv
tools: phpstan, cs2pr
- uses: actions/checkout@master
- uses: actions/checkout@v2
- run: composer install --prefer-dist
- run: ./vendor/bin/phpstan analyse ./src ./tests --error-format=checkstyle | cs2pr

Expand All @@ -61,11 +61,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v1
uses: shivammathur/setup-php@v2
with:
php-version: '7.3'
php-version: '8.1'
extensions: mbstring, intl, gd, xml, dom, json, fileinfo, curl, zip, iconv
- uses: actions/checkout@master
- uses: actions/checkout@v2
- run: composer install --prefer-dist
- run: ./vendor/bin/psalm --output-format=github

Expand All @@ -74,11 +74,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v1
uses: shivammathur/setup-php@v2
with:
php-version: '7.3'
extensions: mbstring, intl, gd, xml, dom, json, fileinfo, curl, zip, iconv
tools: php-cs-fixer, cs2pr
- uses: actions/checkout@master
tools: composer:v2
- uses: actions/checkout@v2
- run: composer install --prefer-dist
- run: ./vendor/bin/security-checker security:check ./composer.lock
- uses: symfonycorp/security-checker-action@v3
31 changes: 31 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Tests
on:
push:
schedule:
- cron: "0 0 * * THU"

jobs:
tests:
runs-on: ubuntu-latest

strategy:
matrix:
php-versions: ['7.4', '8.0', '8.1']
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
tools: composer:v2
- uses: actions/checkout@v2
- uses: php-actions/composer@v6
with:
php_version: ${{ matrix.php-versions }}
version: 2
- run: XDEBUG_MODE=coverage ./vendor/bin/phpunit
- name: Upload coverage results to Coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
composer global require php-coveralls/php-coveralls
php-coveralls --coverage_clover=build/logs/clover.xml -v
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.env
/vendor
composer.lock
.phpunit.result.cache

# Ignore file generated by MacOS
Expand Down
20 changes: 0 additions & 20 deletions .travis.yml

This file was deleted.

33 changes: 26 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,28 @@
CHANGELOG
---------
# Changelog
All notable changes to this project will be documented in this file.

## 0.0.1-alpha (2020-06-12)
- allow conversion of GPS (WGS84) coordinates from/to CH1903/LV03 (MN03)
- allow conversion of GPS (WGS84) coordinates from/to CH1995/LV95 (MN95)
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 0.0.0 (2020-06-12)
- under heavy development
## [Unreleased]
### Changed
- update changelog following 'keep a changelog' format
- run code-styles Github Actions on PHP 8.1
- update symfony checker to use new symfonycorp/security-checker-action
- use assertion with Delta on PHPUnit float values

### Added
- add run of tests on Github Actions
- add coverage to coveralls

### Removed
- remove Travis integration for tests
- remove StyleCI integration

## [0.0.1-alpha] - 2020-06-12
### Added
- allow conversion of GPS (WGS84) coordinates from/to CH1903/LV03 (MN03)
- allow conversion of GPS (WGS84) coordinates from/to CH1995/LV95 (MN95)

[Unreleased]: https://github.com/antistatique/swisstopo/compare/0.0.1-alpha...HEAD
[0.0.1-alpha]: https://github.com/antistatique/swisstopo/releases/tag/0.0.1-alpha
9 changes: 0 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,6 @@ It can modernize your code (like converting the pow function to the ** operator
./vendor/bin/phpstan analyse ./ --error-format=checkstyle
```

### Asserts Security Vulnerabilities

The [SensioLabs Security Checker](https://github.com/sensiolabs/security-checker) is a command line tool that checks
if the application uses dependencies with known security vulnerabilitie.

```bash
./vendor/bin/security-checker security:check ./composer.lock
```

### Improve global code quality using PHPCPD (Code duplication) & PHPMD (PHP Mess Detector)

Detect overcomplicated expressions & Unused parameters, methods, properties
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
Convert World Coordinates to Swiss Coordinates - and vice versa
=============

[![Build Status](https://travis-ci.com/antistatique/swisstopo.svg?branch=dev)](https://travis-ci.com/antistatique/swisstopo)
[![StyleCI](https://github.styleci.io/repos/207270598/shield?branch=master)](https://github.styleci.io/repos/207270598)
[![Coverage Status](https://coveralls.io/repos/github/antistatique/swisstopo/badge.svg?branch=dev)](https://coveralls.io/github/antistatique/swisstopo?branch=dev)
[![Build](https://github.com/antistatique/swisstopo/actions/workflows/tests.yml/badge.svg)](https://github.com/antistatique/swisstopo/actions/workflows/tests.yml)
[![Packagist](https://img.shields.io/packagist/dt/antistatique/swisstopo.svg?maxAge=2592000)](https://packagist.org/packages/antistatique/swisstopo)
[![License](https://poser.pugx.org/antistatique/swisstopo/license)](https://packagist.org/packages/antistatique/swisstopo)
[![PHP Versions Supported](https://img.shields.io/badge/php-%3E%3D%207.1-8892BF.svg)](https://packagist.org/packages/antistatique/swisstopo)
Expand Down
3 changes: 0 additions & 3 deletions bin/post-commit
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,3 @@ echo "\n🙏 \033[0;32mRunning Psalm ...\033[0m"

echo "\n👻 \033[0;32mRunning PHPStan ...\033[0m"
./vendor/bin/phpstan analyse ./src ./tests --error-format=checkstyle

echo "\n⛔ \033[0;32mRunning SensioLabs Security Checker ...\033[0m"
./vendor/bin/security-checker security:check ./composer.lock
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Convert GPS (WGS84) to Swiss (LV03 and LV95) coordinates (and vice versa)",
"license": "MIT",
"require": {
"php": ">=7.0"
"php": ">=7.4"
},
"require-dev": {
"phpunit/phpunit": "^9.0.0",
Expand Down
Loading

0 comments on commit a35cbac

Please sign in to comment.