Skip to content
This repository was archived by the owner on Aug 1, 2021. It is now read-only.

Commit 4174912

Browse files
Merge pull request #301 from technote-space/chore/chore-sync-workflows
chore: sync workflows
2 parents 2b8beb5 + 68b8a1e commit 4174912

File tree

7 files changed

+159
-31
lines changed

7 files changed

+159
-31
lines changed

.github/release-drafter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ categories:
2323
- title: ':sparkles: All Changes'
2424
labels:
2525
- 'Type: Release'
26-
exclude-lables:
26+
exclude-labels:
2727
- 'dependencies'
2828
template: |
2929
## What’s Changed

.github/workflows/ci.yml

Lines changed: 124 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,32 @@ jobs:
1717
name: ESLint
1818
runs-on: ubuntu-latest
1919
steps:
20-
- uses: actions/checkout@v1
20+
- uses: actions/checkout@v2
2121
with:
2222
fetch-depth: 3
23+
- uses: technote-space/get-diff-action@v1
24+
with:
25+
PREFIX_FILTER: assets/js/
26+
SUFFIX_FILTER: .js
27+
FILES: .eslintrc
28+
- name: Get Yarn Cache Directory
29+
id: yarn-cache
30+
run: echo "::set-output name=dir::$(yarn cache dir)"
31+
if: env.GIT_DIFF
32+
- name: Cache node dependencies
33+
uses: actions/cache@v1
34+
with:
35+
path: ${{ steps.yarn-cache.outputs.dir }}
36+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
37+
restore-keys: |
38+
${{ runner.os }}-yarn-
39+
if: env.GIT_DIFF
2340
- name: Prepare setting
2441
run: git clone --depth=1 https://github.com/wp-content-framework/travis-ci.git travis-ci && bash travis-ci/bin/prepare.sh
42+
if: env.GIT_DIFF
2543
- name: Check code style
2644
run: bash travis-ci/bin/js/js-lint.sh
45+
if: env.GIT_DIFF
2746
- uses: 8398a7/action-slack@v1
2847
with:
2948
type: failure
@@ -35,13 +54,34 @@ jobs:
3554
name: PHP Code Sniffer
3655
runs-on: ubuntu-latest
3756
steps:
38-
- uses: actions/checkout@v1
57+
- uses: actions/checkout@v2
3958
with:
4059
fetch-depth: 3
60+
- uses: technote-space/get-diff-action@v1
61+
with:
62+
PREFIX_FILTER: |
63+
configs/
64+
src/
65+
tests/
66+
SUFFIX_FILTER: .php
67+
- name: Get Composer Cache Directory
68+
id: composer-cache
69+
run: |
70+
echo "::set-output name=dir::$(composer config cache-files-dir)"
71+
if: env.GIT_DIFF
72+
- uses: actions/cache@v1
73+
with:
74+
path: ${{ steps.composer-cache.outputs.dir }}
75+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
76+
restore-keys: |
77+
${{ runner.os }}-composer-
78+
if: env.GIT_DIFF
4179
- name: Prepare setting
4280
run: git clone --depth=1 https://github.com/wp-content-framework/travis-ci.git travis-ci && bash travis-ci/bin/prepare.sh
81+
if: env.GIT_DIFF
4382
- name: Check code style
4483
run: bash travis-ci/bin/php/phpcs.sh
84+
if: env.GIT_DIFF
4585
- uses: 8398a7/action-slack@v1
4686
with:
4787
type: failure
@@ -53,13 +93,34 @@ jobs:
5393
name: PHPMD
5494
runs-on: ubuntu-latest
5595
steps:
56-
- uses: actions/checkout@v1
96+
- uses: actions/checkout@v2
5797
with:
5898
fetch-depth: 3
99+
- uses: technote-space/get-diff-action@v1
100+
with:
101+
PREFIX_FILTER: |
102+
configs/
103+
src/
104+
tests/
105+
SUFFIX_FILTER: .php
106+
- name: Get Composer Cache Directory
107+
id: composer-cache
108+
run: |
109+
echo "::set-output name=dir::$(composer config cache-files-dir)"
110+
if: env.GIT_DIFF
111+
- uses: actions/cache@v1
112+
with:
113+
path: ${{ steps.composer-cache.outputs.dir }}
114+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
115+
restore-keys: |
116+
${{ runner.os }}-composer-
117+
if: env.GIT_DIFF
59118
- name: Prepare setting
60119
run: git clone --depth=1 https://github.com/wp-content-framework/travis-ci.git travis-ci && bash travis-ci/bin/prepare.sh
120+
if: env.GIT_DIFF
61121
- name: Check code style
62122
run: bash travis-ci/bin/php/phpmd.sh
123+
if: env.GIT_DIFF
63124
- uses: 8398a7/action-slack@v1
64125
with:
65126
type: failure
@@ -76,23 +137,50 @@ jobs:
76137
matrix:
77138
node: ['10', '11', '12']
78139
steps:
79-
- uses: actions/checkout@v1
140+
- uses: actions/checkout@v2
80141
with:
81142
fetch-depth: 3
143+
- uses: technote-space/get-diff-action@v1
144+
with:
145+
PREFIX_FILTER: assets/js/
146+
SUFFIX_FILTER: |
147+
.js
148+
.snap
149+
FILES: |
150+
yarn.lock
151+
jest.config.js
82152
- name: Setup node
83153
uses: actions/setup-node@v1
84154
with:
85155
node-version: ${{ matrix.node }}
156+
if: env.GIT_DIFF || github.event_name == 'push'
157+
- name: Get Yarn Cache Directory
158+
id: yarn-cache
159+
run: echo "::set-output name=dir::$(yarn cache dir)"
160+
if: env.GIT_DIFF || github.event_name == 'push'
161+
- name: Cache node dependencies
162+
uses: actions/cache@v1
163+
with:
164+
path: ${{ steps.yarn-cache.outputs.dir }}
165+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
166+
restore-keys: |
167+
${{ runner.os }}-yarn-
168+
if: env.GIT_DIFF || github.event_name == 'push'
86169
- name: Prepare setting
87170
run: git clone --depth=1 https://github.com/wp-content-framework/travis-ci.git travis-ci && bash travis-ci/bin/prepare.sh
171+
if: env.GIT_DIFF || github.event_name == 'push'
88172
- name: Run tests
89173
run: bash travis-ci/bin/js/js-test.sh
174+
if: env.GIT_DIFF || github.event_name == 'push'
90175
- name: Codecov
91-
run: curl -s https://codecov.io/bash | bash -s -- -t $CODECOV_TOKEN -f $COVERAGE_FILE
176+
run: |
177+
if [ -n "$CODECOV_TOKEN" ]; then
178+
curl -s https://codecov.io/bash | bash -s -- -t $CODECOV_TOKEN -f $COVERAGE_FILE
179+
fi
92180
env:
93181
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
94182
COVERAGE_FILE: ./assets/js/coverage/lcov.info
95-
if: matrix.node == '12'
183+
if: matrix.node == '12' && (env.GIT_DIFF || github.event_name == 'push')
96184
- uses: 8398a7/action-slack@v1
97185
with:
98186
type: failure
@@ -112,7 +200,7 @@ jobs:
112200
strategy:
113201
matrix:
114202
php: ['7.0', '7.3', '5.6']
115-
WP_VERSION: ['latest', '5.2', '4.6']
203+
WP_VERSION: ['latest', '4.6']
116204
WP_MULTISITE: ['0', '1']
117205
include:
118206
- php: '7.3'
@@ -123,32 +211,58 @@ jobs:
123211
- php: '7.3'
124212
WP_VERSION: '4.6'
125213
steps:
126-
- uses: actions/checkout@v1
214+
- uses: actions/checkout@v2
127215
with:
128216
fetch-depth: 3
217+
- uses: technote-space/get-diff-action@v1
218+
with:
219+
PREFIX_FILTER: |
220+
configs/
221+
src/
222+
tests/
223+
SUFFIX_FILTER: .php
224+
FILES: composer.lock
129225
- name: Switch PHP version
130226
env:
131227
PHP_VERSION: ${{ matrix.php }}
132228
run: sudo ln -sf "/usr/bin/php$PHP_VERSION" /etc/alternatives/php
229+
if: env.GIT_DIFF || github.event_name == 'push'
230+
- name: Get Composer Cache Directory
231+
id: composer-cache
232+
run: |
233+
echo "::set-output name=dir::$(composer config cache-files-dir)"
234+
if: env.GIT_DIFF || github.event_name == 'push'
235+
- uses: actions/cache@v1
236+
with:
237+
path: ${{ steps.composer-cache.outputs.dir }}
238+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
239+
restore-keys: |
240+
${{ runner.os }}-composer-
241+
if: env.GIT_DIFF || github.event_name == 'push'
133242
- name: Prepare setting
134243
run: git clone --depth=1 https://github.com/wp-content-framework/travis-ci.git travis-ci && bash travis-ci/bin/prepare.sh
135244
env:
136245
WP_VERSION: ${{ matrix.WP_VERSION }}
137246
WP_MULTISITE: ${{ matrix.WP_MULTISITE }}
138247
ACTIVATE_POPULAR_PLUGINS: ${{ matrix.ACTIVATE_POPULAR_PLUGINS }}
248+
if: env.GIT_DIFF || github.event_name == 'push'
139249
- name: Run tests
140250
run: bash travis-ci/bin/php/wp-test.sh
141251
env:
142252
DB_PASS: root
143253
WP_VERSION: ${{ matrix.WP_VERSION }}
144254
WP_MULTISITE: ${{ matrix.WP_MULTISITE }}
145255
ACTIVATE_POPULAR_PLUGINS: ${{ matrix.ACTIVATE_POPULAR_PLUGINS }}
256+
if: env.GIT_DIFF || github.event_name == 'push'
146257
- name: Codecov
147-
run: curl -s https://codecov.io/bash | bash -s -- -t $CODECOV_TOKEN -f $COVERAGE_FILE
258+
run: |
259+
if [ -n "$CODECOV_TOKEN" ]; then
260+
curl -s https://codecov.io/bash | bash -s -- -t $CODECOV_TOKEN -f $COVERAGE_FILE
261+
fi
148262
env:
149263
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
150264
COVERAGE_FILE: ./coverage/clover.xml
151-
if: matrix.ACTIVATE_POPULAR_PLUGINS == 1
265+
if: matrix.ACTIVATE_POPULAR_PLUGINS == 1 && (env.GIT_DIFF || github.event_name == 'push')
152266
- uses: 8398a7/action-slack@v1
153267
with:
154268
type: failure

.github/workflows/gh_releases.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Draft Release
12-
uses: toolmantim/release-drafter@v5.2.0
12+
uses: release-drafter/release-drafter@v5
1313
env:
1414
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/issue_opened.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010
- name: Assign issues to project
11-
uses: alex-page/github-project-automation-plus@v0.0.3
11+
uses: technote-space/create-project-card-action@v1
1212
with:
13-
project: Backlog
14-
column: To do
15-
repo-token: ${{ secrets.GITHUB_TOKEN }}
13+
PROJECT: Backlog
14+
COLUMN: To do
15+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1616

1717
assignAuthor:
1818
name: Assign author to issue

.github/workflows/pr_opened.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010
- name: Assign PullRequest to Project
11-
uses: alex-page/github-project-automation-plus@v0.0.3
11+
uses: technote-space/create-project-card-action@v1
1212
with:
13-
project: Backlog
14-
column: To do
15-
repo-token: ${{ secrets.GITHUB_TOKEN }}
13+
PROJECT: Backlog
14+
COLUMN: To do
15+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1616

1717
assignAuthor:
1818
name: Assign author to PR
@@ -28,6 +28,6 @@ jobs:
2828
runs-on: ubuntu-latest
2929
steps:
3030
- name: PR Labeler
31-
uses: technote-fork/pr-labeler-action@master
32-
env:
31+
uses: technote-space/pr-labeler-action@v3
32+
with:
3333
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ on:
22
push:
33
tags:
44
- 'v*'
5+
repository_dispatch:
6+
types: [release]
57

68
name: Release
79

@@ -11,13 +13,17 @@ env:
1113

1214
jobs:
1315
test:
14-
name: Test
15-
runs-on: ubuntu-latest
16+
name: Test before release
17+
runs-on: ubuntu-16.04
1618
steps:
1719
- name: Checkout
18-
uses: actions/checkout@v1
20+
uses: actions/checkout@v2
1921
with:
2022
fetch-depth: 3
23+
- name: Switch PHP version
24+
env:
25+
PHP_VERSION: '5.6'
26+
run: sudo ln -sf "/usr/bin/php$PHP_VERSION" /etc/alternatives/php
2127
- name: Prepare setting
2228
run: git clone --depth=1 https://github.com/wp-content-framework/travis-ci.git travis-ci && bash travis-ci/bin/prepare.sh
2329
- name: Run tests
@@ -41,14 +47,15 @@ jobs:
4147
runs-on: ubuntu-latest
4248
steps:
4349
- name: Checkout
44-
uses: actions/checkout@v1
50+
uses: actions/checkout@v2
4551
with:
4652
fetch-depth: 3
4753
- name: Build
4854
run: |
4955
git clone --depth=1 https://github.com/wp-content-framework/travis-ci.git travis-ci
5056
bash travis-ci/bin/deploy/gh-pages.sh
5157
env:
58+
TRAVIS_BUILD_DIR: ${{ github.workspace }}
5259
GH_PAGES_APP_ID: editor
5360
GH_PAGES_PLUGIN_SCRIPT: ./index.min.js
5461
GH_PAGES_PLUGIN_STYLE: ./index.css
@@ -72,18 +79,23 @@ jobs:
7279
releases:
7380
name: Upload build files
7481
needs: test
75-
runs-on: ubuntu-latest
82+
runs-on: ubuntu-16.04
83+
if: github.event_name != 'repository_dispatch'
7684
steps:
7785
- name: Checkout
78-
uses: actions/checkout@v1
86+
uses: actions/checkout@v2
7987
with:
8088
fetch-depth: 3
89+
- name: Switch PHP version
90+
env:
91+
PHP_VERSION: '5.6'
92+
run: sudo ln -sf "/usr/bin/php$PHP_VERSION" /etc/alternatives/php
8193
- name: Prepare setting
8294
run: git clone --depth=1 https://github.com/wp-content-framework/travis-ci.git travis-ci && bash travis-ci/bin/prepare.sh
8395
- name: Build
8496
run: source travis-ci/bin/deploy/env.sh && bash travis-ci/bin/deploy/create.sh
8597
- name: Upload
86-
uses: technote-fork/action-gh-release@v1
98+
uses: technote-space/action-gh-release@v2
8799
with:
88100
files: release.zip
89101
draft: true

.github/workflows/update-dependencies.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
on:
22
schedule:
3-
- cron: 0 17 * * 5
3+
- cron: 0 17 * * 6
44
pull_request:
55
types: [opened, synchronize, reopened, closed]
6+
repository_dispatch:
7+
types: [update-deps]
68

79
name: Update dependencies
810

@@ -12,7 +14,7 @@ env:
1214
TRAVIS_BUILD_DIR: ${{ github.workspace }}
1315

1416
jobs:
15-
release:
17+
update:
1618
name: Update dependencies
1719
runs-on: ubuntu-latest
1820
steps:

0 commit comments

Comments
 (0)