Skip to content

Commit

Permalink
Add static version check in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Korbeil committed Dec 9, 2023
1 parent f7838ed commit ba36bbc
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/scripts/check-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

LAST_TAG=`git describe --tags --abbrev=0`
IFS=. components=(${LAST_TAG##*-})
exit `php -r "require_once __DIR__.'/vendor/autoload.php'; use AutoMapper\AutoMapper; echo (AutoMapper::MAJOR_VERSION >= intval(\"${components[0]}\") && AutoMapper::MINOR_VERSION >= intval(\"${components[1]}\")) ? 0 : 1;"`
20 changes: 20 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,23 @@ jobs:
run: composer update --prefer-stable
- name: tests
run: vendor/bin/phpunit
check-version:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@master
- name: cache-composer
uses: actions/cache@v2
with:
path: ~/.composer/cache/
key: composer-${{ github.sha }}
- name: setup
uses: shivammathur/[email protected]
with:
php-version: 8.2
coverage: none
extensions: mbstring, fileinfo, json, intl, dom
- name: composer install
run: composer update --prefer-stable
- name: check version
run: ./.github/scripts/check-version.sh
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ 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).

## [Unreleased]
### Added
- [GH#21](https://github.com/jolicode/automapper/pull/21) Add VERSION constants within AutoMapper class and use it for transformers hashes

## [8.0.2] - 2023-11-06
### Added
Expand Down

0 comments on commit ba36bbc

Please sign in to comment.