-
Notifications
You must be signed in to change notification settings - Fork 2k
58 lines (55 loc) · 1.66 KB
/
Typecho-dev-Ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Typecho Dev Test
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
php:
name: PHP ${{ matrix.php }} Tests
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'skip ci')"
strategy:
fail-fast: false
matrix:
php: ['7.2', '7.3', '7.4', '8.0']
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup PHP only
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
- name: Test
run: |
find . -type f -name '*.php' -print0 | xargs -0 -n1 -P4 php -l -n | (! grep -v "No syntax errors detected" )
build:
name: Typecho Build
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'skip ci') && github.event_name != 'pull_request'"
needs:
- php
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Build
run: |
mkdir build
cp -r LICENSE.txt index.php install.php admin install usr var build/
mkdir build/usr/uploads/
chmod 777 build/usr/uploads/
touch build/usr/uploads/empty
rm -rf build/admin/src
- name: Upload a Build Artifact
uses: actions/upload-artifact@v2
with:
name: typecho
path: ./build/
- name: Trigger build
run: |
curl -XPOST -H "Authorization: token ${{ secrets.WORKFLOW_TOKEN }}" \
-H "Accept: application/vnd.github.everest-preview+json" \
-H "Content-Type: application/json" \
https://api.github.com/repos/typecho/languages/actions/workflows/update.yml/dispatches --data '{"ref": "master"}'