forked from phper-framework/phper
-
-
Notifications
You must be signed in to change notification settings - Fork 0
138 lines (119 loc) · 3.56 KB
/
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# Copyright (c) 2022 PHPER Framework Team
# PHPER is licensed under Mulan PSL v2.
# You can use this software according to the terms and conditions of the Mulan
# PSL v2. You may obtain a copy of Mulan PSL v2 at:
# http://license.coscl.org.cn/MulanPSL2
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY
# KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
# NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
name: CI
on:
push:
branches:
- master
pull_request:
branches: [ "**" ]
env:
RUST_LOG: debug
CARGO_TERM_COLOR: always
RUST_BACKTRACE: "1"
RUSTFLAGS: "-D warnings"
LLVM_CONFIG_PATH: llvm-config-14
jobs:
required:
name: Required
needs:
- ci
runs-on: ubuntu-20.04
steps:
- name: Check results
run: |
[[ ${{ needs.ci.result }} == 'success' ]] || exit 1;
ci:
name: CI
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
php-version:
- "8.1"
- "8.2"
- "8.3"
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
# - name: Setup system
# run: |
# sudo apt-get update && sudo apt-get upgrade -y
# sudo apt-get install -y llvm-14-dev libclang-14-dev clang-14 build-essential
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: php-config,composer
- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v1
with:
version: "16.0"
- name: Setup php-fpm
run: |
sudo apt-get install -y php${{ matrix.php-version }}-fpm
sudo rm -f /usr/sbin/php-fpm
sudo ln -s /usr/sbin/php-fpm${{ matrix.php-version }} /usr/sbin/php-fpm
- name: PHP version
run: |
php --version
php-fpm --version
php-config || true
[[ `php --version` == PHP\ ${{ matrix.php-version }}.* ]] || exit 1;
[[ `php-fpm --version` == PHP\ ${{ matrix.php-version }}.* ]] || exit 1;
[[ `php-config --version` == ${{ matrix.php-version }}.* ]] || exit 1;
- name: Install Rust Nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
components: rustfmt
# - name: Setup cargo cache
# uses: actions/cache@v3
# with:
# path: |
# ~/.cargo/bin/
# ~/.cargo/registry/index/
# ~/.cargo/registry/cache/
# ~/.cargo/git/db/
# target/
# key: ${{ matrix.os }}-ci-${{ matrix.php-version }}-${{ hashFiles('**/Cargo.lock') }}
- name: Cargo fmt
uses: actions-rs/cargo@v1
with:
toolchain: nightly
command: fmt
args: --all -- --check
- name: Cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --release
- name: Cargo build
uses: actions-rs/cargo@v1
with:
command: build
args: --release
- name: Cargo test
uses: actions-rs/cargo@v1
with:
command: test
args: --release -- --nocapture
- name: Cargo doc
uses: actions-rs/cargo@v1
env:
RUSTDOCFLAGS: "-D warnings --cfg docsrs"
with:
toolchain: nightly
command: doc
args: --workspace --no-deps --all-features