Skip to content

Commit 78f6df2

Browse files
committed
Revisit GitHub Actions
1 parent cee52fa commit 78f6df2

File tree

4 files changed

+85
-55
lines changed

4 files changed

+85
-55
lines changed

.github/dependabot.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "composer"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
commit-message:
8+
prefix: "deps"
9+
allow:
10+
- dependency-type: "direct"
11+
- package-ecosystem: "github-actions"
12+
directory: "/"
13+
schedule:
14+
interval: "weekly"
15+
commit-message:
16+
prefix: "deps"

.github/netlicensing-php-dependabot.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

.github/workflows/netlicensing-php-demo.yml

Lines changed: 44 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,56 @@ name: PHP Client - Demo Test
22

33
on:
44
push:
5-
branches: [ "master" ]
5+
branches:
6+
- master
7+
- feature/**
68
pull_request:
7-
branches: [ "master" ]
9+
branches:
10+
- master
11+
- feature/**
12+
workflow_dispatch:
813

914
permissions:
1015
contents: read
1116

1217
jobs:
1318
build:
14-
15-
runs-on: ubuntu-latest
19+
runs-on: ubuntu-22.04
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
php-version: ['8.2', '8.3', '8.4']
1624

1725
steps:
18-
- uses: actions/checkout@v4
19-
20-
- name: Setup PHP
21-
uses: shivammathur/setup-php@v2
22-
with:
23-
php-version: '8.2'
24-
25-
- name: Validate composer.json and composer.lock
26-
run: composer validate --strict
27-
28-
- name: Cache Composer packages
29-
id: composer-cache
30-
uses: actions/cache@v3
31-
with:
32-
path: vendor
33-
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
34-
restore-keys: |
35-
${{ runner.os }}-php-
36-
37-
- name: Install dependencies
38-
run: composer install --prefer-dist --no-progress
39-
40-
- name: Run test suite
41-
run: |
42-
cd ./demo
43-
php ./NetLicensingDemo.php
26+
- uses: actions/checkout@v4
27+
28+
- name: Setup PHP ${{ matrix.php-version }}
29+
uses: shivammathur/setup-php@v2
30+
with:
31+
php-version: ${{ matrix.php-version }}
32+
coverage: none
33+
tools: composer:v2
34+
35+
- name: Validate composer manifests
36+
run: composer validate --strict
37+
38+
- name: Cache Composer packages
39+
id: composer-cache
40+
uses: actions/cache@v4
41+
with:
42+
path: vendor
43+
key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }}
44+
restore-keys: |
45+
${{ runner.os }}-php-${{ matrix.php-version }}-
46+
47+
- name: Install dependencies
48+
run: composer install --prefer-dist --no-progress --no-interaction
49+
50+
- name: Run PHPUnit
51+
run: vendor/bin/phpunit --testsuite "Application Test Suite"
52+
53+
- name: Run demo scenario (latest PHP)
54+
if: matrix.php-version == '8.4'
55+
run: |
56+
cd demo
57+
php NetLicensingDemo.php
Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,34 @@
11
name: PHP Client - Dependency Test
22

3-
permissions:
4-
contents: read
5-
63
on:
74
schedule:
8-
- cron: '*/30 * * * *'
5+
- cron: '0 2 * * *'
6+
workflow_dispatch:
97

10-
jobs:
11-
build:
8+
permissions:
9+
contents: read
1210

13-
runs-on: ubuntu-latest
11+
jobs:
12+
dependency-check:
13+
runs-on: ubuntu-22.04
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
php-version: ['8.2', '8.3']
1418

1519
steps:
16-
- name: Init project
17-
run: |
18-
composer create-project composer/semver netlicensing-php-dependency
20+
- name: Setup PHP ${{ matrix.php-version }}
21+
uses: shivammathur/setup-php@v2
22+
with:
23+
php-version: ${{ matrix.php-version }}
24+
tools: composer:v2
25+
26+
- name: Bootstrap temporary project
27+
run: |
28+
composer create-project --no-interaction --prefer-dist composer/semver netlicensing-php-dependency
1929
20-
- name: Install dependencies
21-
run: |
22-
composer require labs64/netlicensingclient-php
23-
composer install --prefer-dist --no-progress --no-suggest
30+
- name: Require NetLicensing client
31+
working-directory: netlicensing-php-dependency
32+
run: |
33+
composer require --no-interaction labs64/netlicensingclient-php
34+
composer show labs64/netlicensingclient-php

0 commit comments

Comments
 (0)