77 branches :
88 - master
99 pull_request :
10+ env :
11+ # increment this manually to force cache eviction
12+ RUST_CACHE_PREFIX : " v0-rust"
1013
1114jobs :
15+ lint :
16+ name : Lint
17+ runs-on : ubuntu-latest
18+ env :
19+ clang : " 17"
20+ php_version : " 8.2"
21+ steps :
22+ - name : Checkout
23+ uses : actions/checkout@v4
24+ with :
25+ fetch-depth : 0
26+ - name : Check typos
27+ uses : crate-ci/typos@master
28+ - name : Validate commit messages
29+ run : |
30+ git show-ref
31+ curl -sSfL https://github.com/convco/convco/releases/latest/download/convco-ubuntu.zip | zcat > convco
32+ chmod +x convco
33+ ./convco check refs/remotes/origin/master..HEAD
34+ rm convco
35+ - name : Setup PHP
36+ uses : shivammathur/setup-php@v2
37+ with :
38+ php-version : ${{ env.php_version }}
39+ env :
40+ debug : true
41+ - name : Setup Rust
42+ uses : dtolnay/rust-toolchain@master
43+ with :
44+ components : rustfmt, clippy
45+ toolchain : stable
46+ - name : Cache cargo dependencies
47+ uses : Swatinem/rust-cache@v2
48+ with :
49+ prefix-key : ${{ env.RUST_CACHE_PREFIX }}
50+ - name : Cache LLVM and Clang
51+ id : cache-llvm
52+ uses : actions/cache@v3
53+ with :
54+ path : ${{ runner.temp }}/llvm-${{ env.clang }}
55+ key : ubuntu-latest-llvm-${{ env.clang }}
56+ - name : Setup LLVM & Clang
57+ id : clang
58+ uses : KyleMayes/install-llvm-action@v2
59+ with :
60+ version : ${{ env.clang }}
61+ directory : ${{ runner.temp }}/llvm-${{ env.clang }}
62+ cached : ${{ steps.cache-llvm.outputs.cache-hit }}
63+ - name : Configure Clang
64+ run : |
65+ echo "LIBCLANG_PATH=${{ runner.temp }}/llvm-${{ env.clang }}/lib" >> $GITHUB_ENV
66+ echo "LLVM_VERSION=${{ steps.clang.outputs.version }}" >> $GITHUB_ENV
67+ echo "LLVM_CONFIG_PATH=${{ runner.temp }}/llvm-${{ env.clang }}/bin/llvm-config" >> $GITHUB_ENV
68+ - name : Run rustfmt
69+ run : cargo fmt --all -- --check
70+ - name : Run clippy
71+ run : cargo clippy --all -- -D warnings
72+ # Docs
73+ - name : Run rustdoc
74+ run : cargo rustdoc -- -D warnings
75+ - name : Build with docs stub
76+ env :
77+ DOCS_RS : " "
78+ run : cargo clean && cargo build
1279 build :
1380 name : Build and Test
1481 runs-on : ${{ matrix.os }}
59126 # if: matrix.rust == 'stable'
60127 with :
61128 # increment this manually to force cache eviction
62- prefix-key : " v0-rust "
129+ prefix-key : ${{ env.RUST_CACHE_PREFIX }}
63130 # LLVM & Clang
64131 - name : Cache LLVM and Clang
65132 id : cache-llvm
77144 with :
78145 version : ${{ matrix.clang }}
79146 directory : ${{ runner.temp }}/llvm-${{ matrix.clang }}
147+ cached : ${{ steps.cache-llvm.outputs.cache-hit }}
80148 - name : Configure Clang
81149 # Macos build doesn't work with clang < 18. As a build for version 18 is not available, we skip the setup
82150 if : " !contains(matrix.os, 'windows') && !contains(matrix.os, 'macos')"
@@ -89,24 +157,9 @@ jobs:
89157 env :
90158 EXT_PHP_RS_TEST : " "
91159 run : cargo build --release --features closure,anyhow --all
92- # Test & lint
160+ # Test
93161 - name : Test inline examples
94162 run : cargo test --release --all --features closure,anyhow --no-fail-fast
95- - name : Run rustfmt
96- if : matrix.rust == 'stable' && matrix.os == 'ubuntu-latest' && matrix.php == '8.2'
97- run : cargo fmt --all -- --check
98- - name : Run clippy
99- if : matrix.rust == 'stable' && matrix.os == 'ubuntu-latest' && matrix.php == '8.2'
100- run : cargo clippy --all -- -D warnings
101- # Docs
102- - name : Run rustdoc
103- if : matrix.rust == 'stable' && matrix.os == 'ubuntu-latest' && matrix.php == '8.2'
104- run : cargo rustdoc -- -D warnings
105- - name : Build with docs stub
106- if : matrix.rust == 'stable' && matrix.os == 'ubuntu-latest' && matrix.php == '8.2'
107- env :
108- DOCS_RS : " "
109- run : cargo clean && cargo build
110163 build-zts :
111164 name : Build with ZTS
112165 runs-on : ubuntu-latest
0 commit comments