quickly test ci script on dev #38
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
on: | |
push: | |
branches: | |
- '**' | |
pull_request: | |
branches: | |
- '**' | |
name: CI | |
jobs: | |
fmt: | |
name: cargo fmt | |
runs-on: ubuntu-latest | |
container: | |
image: rust:latest | |
steps: | |
- uses: actions/checkout@v3 | |
- run: | | |
rustup component add rustfmt | |
cargo fmt --all -- --check | |
check: | |
name: Check | |
env: | |
SQLX_OFFLINE: true | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Check .sqlx directory presence | |
run: | | |
if [ ! -d ".sqlx" ]; then | |
echo ".sqlx directory is missing. Failing the workflow." | |
exit 1 | |
else | |
echo ".sqlx directory is present. Continuing..." | |
ls -la .sqlx | |
fi | |
- name: Checkout submodules | |
run: git submodule update --init --recursive | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: '1.19' | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable-x86_64-unknown-linux-gnu | |
default: true | |
override: true | |
- name: List project directory contents after checkout | |
run: | | |
ls -la | |
echo "Contents of .sqlx directory (if present):" | |
ls -la .sqlx || echo ".sqlx directory not found." | |
- uses: actions-rs/cargo@v1 | |
continue-on-error: false | |
with: | |
command: check | |
- name: Run Clippy | |
run: | | |
rustup component add clippy | |
cargo clippy --all-features --all-targets -- -D warnings | |
test: | |
name: Test Suite | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Checkout submodules | |
run: git submodule update --init --recursive | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: '1.19' | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable-x86_64-unknown-linux-gnu | |
default: true | |
override: true | |
- uses: actions-rs/cargo@v1 | |
continue-on-error: false | |
with: | |
command: build | |
- uses: actions-rs/cargo@v1 | |
continue-on-error: false | |
with: | |
command: test |