Skip to content

Commit 24736c0

Browse files
authored
Update GH Actions (#2)
1 parent 0353074 commit 24736c0

File tree

5 files changed

+113
-7
lines changed

5 files changed

+113
-7
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
/.* export-ignore
2+
/*.md export-ignore

.github/FUNDING.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github: mlocati
2+
custom: https://paypal.me/mlocati

.github/workflows/create-release-attachment.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,24 @@ jobs:
99
attach-zip:
1010
name: Attach ZIP to release
1111
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
1214
steps:
13-
- name: Setup PHP
15+
-
16+
name: Setup PHP
1417
uses: shivammathur/setup-php@v2
1518
with:
16-
php-version: '5.5'
17-
tools: composer:v1
19+
php-version: '8.4'
20+
tools: composer:v2.2
1821
coverage: none
19-
- name: Checkout
20-
uses: actions/checkout@v3
21-
- name: Create and attach ZIP
22+
-
23+
name: Checkout
24+
uses: actions/checkout@v4
25+
-
26+
name: Create and attach ZIP
2227
uses: concrete5-community/gh-package-release-attach@main
2328
env:
2429
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2530
with:
2631
remove-files: |
2732
composer.json
28-
composer.lock

.github/workflows/tests.yml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags-ignore:
8+
- '**'
9+
pull_request:
10+
branches:
11+
- main
12+
13+
jobs:
14+
15+
check-php-syntax:
16+
name: PHP ${{ matrix.php-version }} Syntax
17+
runs-on: ubuntu-latest
18+
strategy:
19+
matrix:
20+
php-version:
21+
- "5.5"
22+
- "8.4"
23+
steps:
24+
-
25+
name: Checkout
26+
uses: actions/checkout@v4
27+
-
28+
name: Install PHP
29+
uses: shivammathur/setup-php@v2
30+
with:
31+
php-version: ${{ matrix.php-version }}
32+
extensions: opcache
33+
coverage: none
34+
tools: none
35+
-
36+
name: Check syntax
37+
uses: mlocati/check-php-syntax@v1
38+
with:
39+
fail-on-warnings: true
40+
41+
check-development-leftovers:
42+
name: Check Development Leftovers
43+
runs-on: ubuntu-latest
44+
steps:
45+
-
46+
name: Checkout
47+
uses: actions/checkout@v4
48+
-
49+
name: Search for debugger or xdebug_break
50+
run: |
51+
echo "Scanning for 'debugger' or 'xdebug_break'..."
52+
matches=$(grep -Enr --include=\*.{js,php} '(^|[^a-zA-Z0-9_])(debugger|xdebug_break)\b' . || true)
53+
if [[ -n "$matches" ]]; then
54+
echo "Found the following matches:"
55+
echo "$matches"
56+
echo "::error::Development leftovers found in the codebase."
57+
exit 1
58+
else
59+
echo "No development leftovers found."
60+
fi
61+
62+
check-install:
63+
name: Install on Concrete ${{ matrix.ccm-version }}
64+
runs-on: ubuntu-latest
65+
container: ghcr.io/concrete5-community/docker5:${{ matrix.ccm-version }}
66+
needs:
67+
- check-php-syntax
68+
- check-development-leftovers
69+
strategy:
70+
matrix:
71+
ccm-version:
72+
- 8.5.12
73+
- "8.5"
74+
- "9.0"
75+
- "9.1"
76+
- "9.2"
77+
- "9.3"
78+
- "9.4"
79+
- latest
80+
steps:
81+
-
82+
name: Checkout
83+
uses: actions/checkout@v4
84+
-
85+
name: Check composer.json
86+
run: sudo -u www-data composer --ansi --no-interaction validate --strict -- "$GITHUB_WORKSPACE/composer.json"
87+
-
88+
name: Prepare package
89+
run: ln -s "$GITHUB_WORKSPACE" /app/packages/maxmind_geolocator
90+
-
91+
name: Start services
92+
run: ccm-service start db
93+
-
94+
name: Core info
95+
run: sudo -u www-data /app/concrete/bin/concrete5 --ansi --no-interaction c5:info
96+
-
97+
name: Install package
98+
run: sudo -u www-data /app/concrete/bin/concrete5 --ansi --no-interaction c5:package:install maxmind_geolocator

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[![Tests](https://github.com/concrete5-community/maxmind_geolocator/actions/workflows/tests.yml/badge.svg)](https://github.com/concrete5-community/maxmind_geolocator/actions/workflows/tests.yml)

0 commit comments

Comments
 (0)