ci: Added workflow for running tests
This commit is contained in:
@@ -6,7 +6,27 @@ on:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: production
|
||||
container:
|
||||
image: rust:latest
|
||||
steps:
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y git sqlite3
|
||||
|
||||
- name: Checkout Code
|
||||
run: |
|
||||
git config --global --add safe.directory '*'
|
||||
rm -rf * .git || true
|
||||
git clone --depth 1 $GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git .
|
||||
|
||||
- name: Run Tests
|
||||
run: cargo test
|
||||
|
||||
deploy:
|
||||
needs: test
|
||||
runs-on: production
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
|
||||
33
.gitea/workflows/test.yml
Normal file
33
.gitea/workflows/test.yml
Normal file
@@ -0,0 +1,33 @@
|
||||
name: Continuous Integration
|
||||
|
||||
on:
|
||||
push:
|
||||
branches-ignore:
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: production
|
||||
container:
|
||||
image: rust:latest
|
||||
steps:
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y git sqlite3
|
||||
|
||||
- name: Checkout Code
|
||||
run: |
|
||||
git config --global --add safe.directory '*'
|
||||
rm -rf * .git || true
|
||||
git clone --depth 1 $GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git .
|
||||
|
||||
- name: Check Formatting
|
||||
run: cargo fmt -- --check || echo "Formatting issues found, but proceeding anyway for now"
|
||||
|
||||
- name: Run Tests
|
||||
# We explicitly set SQLx offline mode just in case, though our tests use an in-memory DB
|
||||
run: cargo test
|
||||
Reference in New Issue
Block a user