Added Regular Expression Formatting #300
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Rust | |
on: [push, pull_request] | |
env: | |
CCACHE: sccache | |
CARGO_TERM_COLOR: never | |
SCCACHE_GHA_ENABLED: "true" | |
SHELL: /bin/bash | |
jobs: | |
Build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [windows-latest, ubuntu-latest, macos-13] | |
rust: [stable, beta] | |
include: | |
- os: windows-latest | |
id: windows | |
- os: macos-13 | |
id: macos | |
- os: ubuntu-latest | |
id: linux | |
env: | |
SCCACHE_CACHE_SIZE: 3G | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Dependencies on Windows | |
if: matrix.id == 'windows' | |
env: | |
MOZTOOLS_LINK: https://github.com/servo/servo-build-deps/releases/download/msvc-deps | |
MOZTOOLS_VERSION: "4.0" | |
run: | | |
curl -SL "$env:MOZTOOLS_LINK/moztools-$env:MOZTOOLS_VERSION.zip" --create-dirs -o target/dependencies/moztools.zip | |
cd target/dependencies && unzip -qo moztools.zip -d . | |
echo 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Tools\LLVM\bin' | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
- name: Install Dependencies on OS X | |
if: matrix.id == 'macos' | |
run: brew install --overwrite python [email protected] llvm sccache yasm | |
- name: Install Dependencies on Linux | |
if: matrix.id == 'linux' | |
run: sudo apt install clang llvm -y | |
- name: Install Rust Toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
components: clippy, rustfmt | |
- name: Install Just | |
uses: taiki-e/install-action@just | |
- name: Setup sccache | |
uses: mozilla-actions/[email protected] | |
- name: Cache Cargo Cache and Git Database | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
key: cargo-${{ matrix.id }}-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: cargo-${{ matrix.id }}- | |
- name: Build POSIX | |
if: matrix.id == 'macos' || matrix.id == 'linux' | |
env: | |
CC: clang | |
CXX: clang++ | |
RUSTC_WRAPPER: sccache | |
run: | | |
just build-release -v | |
just test-release -v | |
mv ./target/release/cli ./target/release/spiderfire | |
strip ./target/release/spiderfire | |
- name: Build Windows | |
if: matrix.id == 'windows' | |
env: | |
MOZTOOLS_PATH: "${{ github.workspace }}\\target\\dependencies\\moztools-4.0" | |
CC: clang-cl.exe | |
CXX: clang-cl.exe | |
LINKER: lld-link.exe | |
run: | | |
just build-release -v | |
just test-release -v | |
Rename-Item -Path .\target\release\cli.exe -NewName spiderfire.exe | |
- name: Upload Executables as Artifacts | |
uses: actions/upload-artifact@v2 | |
if: matrix.rust == 'stable' | |
with: | |
name: spiderfire-${{ github.sha }}-${{ matrix.id }} | |
path: target/release/spiderfire${{ matrix.id == 'windows' && '.exe' || '' }} | |
if-no-files-found: error | |
Lint: | |
runs-on: ubuntu-latest | |
env: | |
SCCACHE_CACHE_SIZE: 1G | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Dependencies on Linux | |
run: sudo apt install clang llvm -y | |
- name: Install Rust Toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
components: clippy, rustfmt | |
- name: Install Just | |
uses: taiki-e/install-action@just | |
- name: Setup sccache | |
uses: mozilla-actions/[email protected] | |
- name: Cache Cargo Cache and Git Database | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
key: cargo-lint-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: cargo-lint- | |
- name: Lint | |
env: | |
CC: clang | |
CXX: clang++ | |
RUSTC_WRAPPER: sccache | |
run: just lint |