Skip to content

Commit 9505364

Browse files
Merge pull request #1086 from cloudinary/github-actions
Replace Travis CI with GitHub actions
2 parents 4a1bfe5 + 08813aa commit 9505364

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+112
-128
lines changed

.eslintrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"no-nested-ternary": "off",
2525
"jsx-a11y/click-events-have-key-events": "off",
2626
"react-hooks/rules-of-hooks": "error",
27-
"react-hooks/exhaustive-deps": "warn"
27+
"react-hooks/exhaustive-deps": "warn",
28+
"@wordpress/no-global-event-listener": "off"
2829
}
2930
}

.github/workflows/ci.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
php-version: [ '5.6', '7.4', '8.3' ]
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: Setup PHP
18+
uses: shivammathur/setup-php@v2
19+
with:
20+
php-version: ${{ matrix.php-version }}
21+
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: '16'
26+
cache: 'npm'
27+
28+
- name: Cache Composer
29+
uses: actions/cache@v4
30+
with:
31+
path: ~/.composer/cache
32+
key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
33+
restore-keys: |
34+
${{ runner.os }}-composer-${{ matrix.php }}-
35+
36+
- name: Install dependencies
37+
run: npm ci
38+
39+
- name: Run linting
40+
run: npm run lint
41+
42+
- name: Run build
43+
run: npm run build

.travis.yml

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

cloudinary.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
if ( version_compare( phpversion(), '5.6', '>=' ) ) {
4040
require_once __DIR__ . '/instance.php';
4141
register_activation_hook( __FILE__, array( 'Cloudinary\Utils', 'install' ) );
42-
} else {
42+
} else { // phpcs:ignore Universal.ControlStructures.DisallowLonelyIf.Found
4343
if ( defined( 'WP_CLI' ) ) {
4444
WP_CLI::warning( php_version_text() );
4545
} else {

php/cache/class-cache-point.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,6 @@ public function init() {
287287
$this->registered_cache_points[ $post->post_title ] = $post;
288288
}
289289
do_action( 'cloudinary_cache_init_cache_points' );
290-
291290
}
292291

293292
/**
@@ -526,7 +525,7 @@ public function get_cache_items( $cache_point_id_url, $id_only = false ) {
526525
do {
527526
$found = $posts->get_posts();
528527
$items = array_merge( $items, $found );
529-
$params['paged'] ++;
528+
++$params['paged'];
530529
$posts = new \WP_Query( $params );
531530
} while ( $posts->have_posts() );
532531
}
@@ -884,7 +883,7 @@ public function query_cached_items( $urls ) {
884883
$found_posts[ $url ] = $meta[ self::META_KEYS['cached_urls'] ][ $url ];
885884
}
886885
}
887-
$params['paged'] ++;
886+
++$params['paged'];
888887
$posts = new \WP_Query( $params );
889888
} while ( $posts->have_posts() );
890889

php/class-admin.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ public function register_admin( $page ) {
203203
$page_handle = add_menu_page(
204204
$page['page_title'],
205205
$page['menu_title'],
206-
$page['capability'],
206+
$page['capability'], // phpcs:ignore WordPress.WP.Capabilities.Undetermined
207207
$page['slug'],
208208
'',
209209
$page['icon'],
@@ -245,7 +245,7 @@ public function register_admin( $page ) {
245245
$page['slug'],
246246
$page_title,
247247
$menu_title,
248-
$capability,
248+
$capability, // phpcs:ignore WordPress.WP.Capabilities.Undetermined
249249
$render_slug,
250250
$render_function,
251251
$position

php/class-assets.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1365,7 +1365,7 @@ public function is_asset( $url ) {
13651365
global $wpdb;
13661366

13671367
// Bail early if it's not an URL.
1368-
if ( empty( parse_url( $url, PHP_URL_HOST ) ) ) {
1368+
if ( empty( parse_url( $url, PHP_URL_HOST ) ) ) { // phpcs:ignore WordPress.WP.AlternativeFunctions.parse_url_parse_url
13691369
return false;
13701370
}
13711371

php/class-cache.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,6 @@ protected function get_plugins_table() {
615615
'title' => __( 'Plugin', 'cloudinary' ),
616616
'root_paths' => $rows,
617617
);
618-
619618
}
620619

621620
/**
@@ -987,7 +986,7 @@ public function add_content_cache_paths() {
987986
if ( ! is_admin() ) {
988987
// Exclude content replacement in admin.
989988
$this->add_cache_paths( 'cache_content', 'content_files', 'cache_all_content' );
990-
};
989+
}
991990
}
992991

993992
/**

php/class-delivery-feature.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ public function register_assets() {
157157
* Enqueue Assets.
158158
*/
159159
public function enqueue_assets() {
160-
161160
}
162161

163162
/**

php/class-delivery.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1964,7 +1964,7 @@ protected function filter_unknown_urls( $urls ) {
19641964
return $urls;
19651965
}
19661966

1967-
$known_lookup = array_flip( $known_keys );
1967+
$known_lookup = array_flip( $known_keys );
19681968
$potential_unknown = array_diff( $urls, $known_keys );
19691969

19701970
if ( empty( $potential_unknown ) ) {

0 commit comments

Comments
 (0)