View source #73
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: Gosub Continuous Integration (CI) | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
cache: | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache cargo | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cargo | |
key: ${{ runner.os }}-cargo-registry-${{ matrix.rust_version }}-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: ${{ matrix.os }}-cargo-registry-${{ matrix.rust_version }}- | |
- name: Cargo update | |
run: cargo update | |
build: | |
runs-on: ubuntu-24.04 | |
needs: cache | |
strategy: | |
fail-fast: false | |
matrix: | |
rust_version: [ stable, nightly, 1.79.0 ] | |
os: [ ubuntu-24.04 ] | |
# rust_version: [ stable, beta, nightly, 1.79.0, "stable minus 1 release", "stable minus 2 releases" ] | |
# os: [ ubuntu-24.04, windows-latest, macos-latest ] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.rust_version }} | |
- name: Install dependencies | |
run: sudo apt update -y && sudo apt install libgtk-4-dev libglib2.0-dev libsqlite3-dev libgtksourceview-5-dev -y | |
- name: Cache cargo | |
uses: actions/cache/restore@v4 | |
with: | |
path: | | |
~/work/gtk-browser/gtk-browser/target | |
key: ${{ matrix.os }}-cargo-target-${{ matrix.rust_version }}-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: ${{ matrix.os }}-cargo-registry-${{ matrix.rust_version }}- | |
- name: Build | |
run: | | |
cargo build --verbose --all | |
test: | |
runs-on: ubuntu-24.04 | |
needs: cache | |
strategy: | |
fail-fast: false | |
matrix: | |
rust_version: [ stable, nightly, 1.79.0 ] | |
os: [ ubuntu-24.04 ] | |
# rust_version: [ stable, beta, nightly, 1.79.0, "stable minus 1 release", "stable minus 2 releases" ] | |
# os: [ ubuntu-24.04, windows-latest, macos-latest ] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: sudo apt update -y && sudo apt install libgtk-4-dev libglib2.0-dev libsqlite3-dev libgtksourceview-5-dev -y | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.rust_version }} | |
- name: Cache cargo | |
uses: actions/cache/restore@v4 | |
with: | |
path: | | |
~/work/gtk-browser/gtk-browser/target | |
key: ${{ matrix.os }}-cargo-target-${{ matrix.rust_version }}-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: ${{ matrix.os }}-cargo-registry-${{ matrix.rust_version }}- | |
- name: Run tests | |
run: cargo test --verbose --all --no-fail-fast --all-targets | |
clippy: | |
runs-on: ubuntu-24.04 | |
needs: cache | |
strategy: | |
fail-fast: false | |
matrix: | |
rust_version: [ stable, nightly ] | |
os: [ ubuntu-24.04 ] | |
# rust_version: [ stable, beta, nightly, 1.79.0, "stable minus 1 release", "stable minus 2 releases" ] | |
# os: [ ubuntu-24.04, windows-latest, macos-latest ] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: sudo apt update -y && sudo apt install libgtk-4-dev libglib2.0-dev libsqlite3-dev libgtksourceview-5-dev -y | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.rust_version }} | |
- name: Cache cargo | |
uses: actions/cache/restore@v4 | |
with: | |
path: | | |
~/work/gtk-browser/gtk-browser/target | |
key: ${{ matrix.os }}-cargo-target-${{ matrix.rust_version }}-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: ${{ matrix.os }}-cargo-registry-${{ matrix.rust_version }}- | |
- name: Run Clippy | |
run: cargo clippy --all --tests -- -D warnings | |
fmt: | |
runs-on: ubuntu-24.04 | |
needs: cache | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- name: Run fmt | |
run: cargo fmt --check --all |