-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #306 from madeofpendletonwool/testing
Merging basic tests
- Loading branch information
Showing
47 changed files
with
3,112 additions
and
872 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
name: Pinepods CI | ||
|
||
on: | ||
pull_request: | ||
branches: [main] | ||
push: | ||
branches: [main] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
backend-tests: | ||
runs-on: ubuntu-latest | ||
services: | ||
postgres: | ||
image: postgres:latest | ||
env: | ||
POSTGRES_USER: test_user | ||
POSTGRES_PASSWORD: test_password | ||
POSTGRES_DB: test_db | ||
ports: | ||
- 5432:5432 | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.x" | ||
|
||
- name: Setup test environment | ||
run: | | ||
chmod +x ./setup-tests.sh | ||
./setup-tests.sh | ||
- name: Run backend tests | ||
env: | ||
TEST_MODE: true | ||
DB_HOST: localhost | ||
DB_PORT: 5432 | ||
DB_USER: test_user | ||
DB_PASSWORD: test_password | ||
DB_NAME: test_db | ||
DB_TYPE: postgresql | ||
TEST_DB_TYPE: postgresql | ||
PYTHONPATH: ${{ github.workspace }} | ||
run: | | ||
chmod +x ./run-tests.sh | ||
./run-tests.sh postgresql | ||
frontend-tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: hecrj/setup-rust-action@v2 | ||
with: | ||
rust-version: 1.81 | ||
targets: wasm32-unknown-unknown | ||
|
||
# Install cargo-binstall for other OSes using the standard method | ||
- name: Install cargo-binstall | ||
if: matrix.os != 'macos-latest' | ||
uses: cargo-bins/cargo-binstall@main | ||
|
||
- name: Depends install | ||
if: ${{ env.DEPENDS_SETUP == 'true' }} | ||
run: | | ||
sudo apt update | ||
sudo apt install -qy libgtk-3-dev | ||
sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf | ||
- name: wasm-addition | ||
run: | | ||
rustup target add wasm32-unknown-unknown | ||
- name: Install Trunk | ||
run: | | ||
cargo binstall trunk -y | ||
- name: Run frontend tests | ||
working-directory: ./web | ||
run: | | ||
RUSTFLAGS="--cfg=web_sys_unstable_apis" cargo test --features server_build -- --nocapture | ||
# docker-build: | ||
# runs-on: ubuntu-latest | ||
# needs: [backend-tests, frontend-tests] | ||
# steps: | ||
# - uses: actions/checkout@v3 | ||
|
||
# - name: Set up Docker Buildx | ||
# uses: docker/setup-buildx-action@v2 | ||
|
||
# - name: Build and test Docker image | ||
# run: | | ||
# docker build -t pinepods:test . | ||
# docker run --rm pinepods:test /bin/sh -c "python3 -m pytest /pinepods/tests/" |
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
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
Oops, something went wrong.