diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..6d9951b --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,43 @@ +name: Continuous Integration + +on: + push: + branches-ignore: + - master + paths-ignore: + - '**.md' + - '.gitignore' + - 'docs/**' + pull_request: + branches: + - master + paths-ignore: + - '**.md' + - '.gitignore' + - 'docs/**' + +jobs: + test: + # Use GitHub's official hosted runners instead of your self-hosted ones + runs-on: ubuntu-latest + steps: + - name: Checkout Code + # We can use the official checkout action here since GitHub's runners have Node.js installed natively + uses: actions/checkout@v4 + + - name: Install Rust Toolchain + uses: dtolnay/rust-toolchain@stable + with: + components: rustfmt + + - name: Install Dependencies + run: sudo apt-get update && sudo apt-get install -y sqlite3 + + - name: Cache Cargo Dependencies + uses: Swatinem/rust-cache@v2 + + - name: Check Formatting + run: cargo fmt -- --check || echo "Formatting issues found, but proceeding anyway for now" + + - name: Run Tests + run: cargo test