Split test and build stage

This commit is contained in:
joyqi
2021-08-20 12:17:47 +08:00
parent 6855e9f1f3
commit 0177a0557a
2 changed files with 35 additions and 26 deletions
+33
View File
@@ -0,0 +1,33 @@
name: Typecho Dev Build
on:
push:
branches:
- master
jobs:
build:
name: Typecho Build
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'skip ci')"
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install tree
run: sudo apt-get -y install tree
- name: Build
run: |
mkdir build
cp -r LICENSE.txt *.php admin install usr var build/
mkdir build/usr/uploads/
chmod 777 build/usr/uploads/
rm -rf build/admin/src
tree -d build
- 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.GITHUB_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"}'
+2 -26
View File
@@ -1,4 +1,4 @@
name: Typecho Build Dev Ci
name: Typecho Dev Test
on:
push:
@@ -27,28 +27,4 @@ jobs:
- 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')"
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install tree
run: sudo apt-get -y install tree
- name: Build
run: |
mkdir build
cp -r LICENSE.txt *.php admin install usr var build/
mkdir build/usr/uploads/
chmod 777 build/usr/uploads/
rm -rf build/admin/src
tree -d build
- 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.GITHUB_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"}'