bump to v0.2.7 (#117) #381
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: CI # Continuous Integration | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
test: | |
name: Test Suite (${{ matrix.os-name }}) | |
runs-on: ${{ matrix.os }} | |
env: | |
CARGO_TARGET_I586_UNKNOWN_LINUX_MUSL_RUSTFLAGS: -C target-feature=+sse2 | |
strategy: | |
matrix: | |
include: | |
- os: macos-latest | |
os-name: mac | |
features: default | |
- os: ubuntu-latest | |
os-name: ubuntu | |
features: default | |
- os: windows-latest | |
os-name: windows | |
features: default | |
- os: ubuntu-latest | |
os-name: android | |
target: aarch64-linux-android | |
features: termux --no-default-features | |
- os: ubuntu-latest | |
os-name: ish | |
target: i686-unknown-linux-musl | |
features: default | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@nightly | |
with: | |
targets: ${{ matrix.target }} | |
- uses: Swatinem/rust-cache@v2 | |
- name: Run tests (cross) | |
if: ${{ matrix.target != null }} | |
uses: houseabsolute/actions-rust-cross@v0 | |
with: | |
command: test | |
target: ${{ matrix.target }} | |
args: "--features ${{ matrix.features }} --workspace" | |
cross-version: 7b79041c9278769eca57fae10c74741f5aa5c14b | |
- name: Run tests (default) | |
if: ${{ matrix.target == null }} | |
run: cargo test --features ${{ matrix.features }} --workspace | |
docker: | |
name: Test Docker | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Docker CLI | |
uses: docker/setup-buildx-action@v3 | |
- name: Build Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
push: false | |
context: . | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
tags: rainfrog_test | |
outputs: type=docker | |
- name: init db for docker test | |
run: | | |
make db-up | |
sleep 5 # wait for db container | |
- name: docker run postgres | |
run: | | |
docker run -dit --name rainfrog_test_postgres \ | |
--add-host host.docker.internal:host-gateway \ | |
-e db_driver="postgres" \ | |
-e username="root" \ | |
-e password="password" \ | |
-e hostname="host.docker.internal" \ | |
-e db_port="5499" \ | |
-e db_name="rainfrog" rainfrog_test | |
sleep 5 # wait for container | |
- name: check postgres container status | |
run: | | |
container_status=$(docker ps -f name=rainfrog_test_postgres --format "{{.Status}}") | |
if [[ "$container_status" == "Up"* ]]; then | |
echo "container started" | |
else | |
echo "container did not start" | |
echo "logs: " | |
docker logs -t rainfrog_test_postgres | |
exit 1 | |
fi | |
- name: docker run mysql | |
run: | | |
docker run -dit --name rainfrog_test_mysql \ | |
--add-host host.docker.internal:host-gateway \ | |
-e db_driver="mysql" \ | |
-e username="root" \ | |
-e password="password" \ | |
-e hostname="host.docker.internal" \ | |
-e db_port="3317" \ | |
-e db_name="rainfrog" rainfrog_test | |
sleep 5 # wait for container | |
- name: check mysql container status | |
run: | | |
container_status=$(docker ps -f name=rainfrog_test_mysql --format "{{.Status}}") | |
if [[ "$container_status" == "Up"* ]]; then | |
echo "container started" | |
else | |
echo "container did not start" | |
echo "logs: " | |
docker logs -t rainfrog_test_mysql | |
exit 1 | |
fi | |
- name: docker run sqlite | |
run: | | |
docker run -dit --name rainfrog_test_sqlite \ | |
--add-host host.docker.internal:host-gateway \ | |
-v /home/runner/work/rainfrog/rainfrog/dev/rainfrog.sqlite3:/rainfrog.sqlite3 \ | |
rainfrog_test \ | |
rainfrog --url sqlite:///rainfrog.sqlite3 | |
sleep 5 # wait for container | |
- name: check sqlite container status | |
run: | | |
container_status=$(docker ps -f name=rainfrog_test_sqlite --format "{{.Status}}") | |
if [[ "$container_status" == "Up"* ]]; then | |
echo "container started" | |
else | |
echo "container did not start" | |
echo "logs: " | |
docker logs -t rainfrog_test_sqlite | |
exit 1 | |
fi | |
rustfmt: | |
name: Rustfmt | |
runs-on: ubuntu-latest | |
env: | |
CARGO_TARGET_I586_UNKNOWN_LINUX_MUSL_RUSTFLAGS: -C target-feature=+sse2 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@nightly | |
with: | |
components: rustfmt | |
- uses: Swatinem/rust-cache@v2 | |
- name: Check formatting | |
run: cargo fmt --all --check | |
clippy: | |
name: Clippy | |
runs-on: ubuntu-latest | |
env: | |
CARGO_TARGET_I586_UNKNOWN_LINUX_MUSL_RUSTFLAGS: -C target-feature=+sse2 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@nightly | |
with: | |
components: clippy | |
- uses: Swatinem/rust-cache@v2 | |
- name: Clippy check | |
run: cargo clippy --all-targets --all-features --workspace -- -D warnings |