-
Notifications
You must be signed in to change notification settings - Fork 276
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
988 additions
and
0 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,82 @@ | ||
name: "[demo:ci]" | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
env: | ||
RUST_TOOLCHAIN: stable | ||
TOOLCHAIN_PROFILE: minimal | ||
|
||
jobs: | ||
style: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: read | ||
|
||
steps: | ||
- name: Checkout the code | ||
uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: ${{ env.RUST_TOOLCHAIN }} | ||
components: rustfmt | ||
- name: Setup Rust cache | ||
uses: Swatinem/rust-cache@v2 | ||
- run: cargo fmt --all -- --check | ||
working-directory: ./examples/demo | ||
- name: Run cargo clippy | ||
run: cargo clippy -- -W clippy::nursery -W clippy::pedantic -W rust-2018-idioms -W rust-2021-compatibility | ||
working-directory: ./examples/demo | ||
|
||
test: | ||
needs: [rustfmt, clippy] | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: read | ||
|
||
services: | ||
redis: | ||
image: redis | ||
options: >- | ||
--health-cmd "redis-cli ping" | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
ports: | ||
- "6379:6379" | ||
postgres: | ||
image: postgres | ||
env: | ||
POSTGRES_DB: postgres_test | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
ports: | ||
- "5432:5432" | ||
# Set health checks to wait until postgres has started | ||
options: --health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
|
||
steps: | ||
- name: Checkout the code | ||
uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: ${{ env.RUST_TOOLCHAIN }} | ||
- name: Setup Rust cache | ||
uses: Swatinem/rust-cache@v2 | ||
- name: Install seaorm cli | ||
run: cargo install sea-orm-cli | ||
- name: Run cargo test | ||
run: cargo test --all-features --all | ||
working-directory: ./examples/demo | ||
env: | ||
LOCO_CI_MODE: 1 | ||
REDIS_URL: redis://localhost:${{job.services.redis.ports[6379]}} | ||
DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres_test |
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,105 @@ | ||
name: "[loco-cli:e2e(master)]" | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
jobs: | ||
# TODO: re-enable after 0.8 to check cmd spawning fix | ||
saas-win32: | ||
runs-on: windows-latest | ||
|
||
permissions: | ||
contents: read | ||
|
||
steps: | ||
- name: Checkout the code | ||
uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: nightly | ||
components: rustfmt | ||
- name: Install seaorm cli | ||
run: cargo install sea-orm-cli | ||
- run: | | ||
cargo install --path . | ||
working-directory: ./loco-cli | ||
- run: | | ||
loco new -n saas -t saas --db sqlite --bg async --assets serverside | ||
env: | ||
ALLOW_IN_GIT_REPO: true | ||
- run: | | ||
cargo build | ||
working-directory: ./saas | ||
- run: | | ||
cargo loco routes | ||
working-directory: ./saas | ||
- run: | | ||
cargo loco db migrate | ||
working-directory: ./saas | ||
- run: | | ||
cargo loco generate scaffold movie title:string --htmx | ||
working-directory: ./saas | ||
- run: | | ||
cargo loco db migrate | ||
working-directory: ./saas | ||
saas: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: read | ||
|
||
steps: | ||
- name: Checkout the code | ||
uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: nightly | ||
- run: | | ||
cargo install loco-cli | ||
ALLOW_IN_GIT_REPO=true LOCO_APP_NAME=saas LOCO_TEMPLATE=saas loco new --db postgres --bg queue --assets serverside | ||
- run: | | ||
cargo build | ||
working-directory: ./saas | ||
rest-api: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: read | ||
|
||
steps: | ||
- name: Checkout the code | ||
uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: nightly | ||
- run: | | ||
cargo install loco-cli | ||
ALLOW_IN_GIT_REPO=true LOCO_APP_NAME=restapi LOCO_TEMPLATE=rest-api loco new --db postgres --bg queue | ||
- run: | | ||
cargo build | ||
working-directory: ./restapi | ||
lightweight-service: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: read | ||
|
||
steps: | ||
- name: Checkout the code | ||
uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: nightly | ||
override: true | ||
- run: | | ||
cargo install loco-cli | ||
ALLOW_IN_GIT_REPO=true LOCO_APP_NAME=lightweight LOCO_TEMPLATE=lightweight-service loco new | ||
- run: | | ||
cargo build | ||
working-directory: ./lightweight |
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,63 @@ | ||
name: "[loco-cli:e2e]" | ||
|
||
on: | ||
schedule: | ||
- cron: 0 * * * * # every hour | ||
|
||
jobs: | ||
saas: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: read | ||
|
||
steps: | ||
- name: Checkout the code | ||
uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: nightly | ||
- run: | | ||
cargo install loco-cli | ||
ALLOW_IN_GIT_REPO=true loco new --template saas --name saas --db sqlite --bg async --assets serverside | ||
- run: | | ||
cargo build | ||
working-directory: ./saas | ||
rest-api: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: read | ||
|
||
steps: | ||
- name: Checkout the code | ||
uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: nightly | ||
- run: | | ||
cargo install loco-cli | ||
ALLOW_IN_GIT_REPO=true loco new --template rest-api --name restapi --db sqlite --bg async | ||
- run: | | ||
cargo build | ||
working-directory: ./restapi | ||
lightweight-service: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: read | ||
|
||
steps: | ||
- name: Checkout the code | ||
uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: nightly | ||
- run: | | ||
cargo install loco-cli | ||
ALLOW_IN_GIT_REPO=true loco new --template lightweight-service --name lightweight --db sqlite --bg async | ||
- run: | | ||
cargo build | ||
working-directory: ./lightweight |
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,67 @@ | ||
name: "[loco-gen:ci]" | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
env: | ||
RUST_TOOLCHAIN: stable | ||
TOOLCHAIN_PROFILE: minimal | ||
|
||
defaults: | ||
run: | ||
working-directory: ./loco-gen | ||
|
||
jobs: | ||
style: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: read | ||
|
||
steps: | ||
- name: Checkout the code | ||
uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: ${{ env.RUST_TOOLCHAIN }} | ||
components: rustfmt | ||
- name: Setup Rust cache | ||
uses: Swatinem/rust-cache@v2 | ||
- name: Run cargo fmt | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: fmt | ||
args: --all -- --check | ||
- name: Run cargo clippy | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: clippy | ||
args: --all-features -- -D warnings -W clippy::pedantic -W clippy::nursery -W rust-2018-idioms | ||
|
||
test: | ||
needs: [rustfmt, clippy] | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: read | ||
|
||
steps: | ||
- name: Checkout the code | ||
uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: ${{ env.RUST_TOOLCHAIN }} | ||
- name: Setup Rust cache | ||
uses: Swatinem/rust-cache@v2 | ||
|
||
- run: | | ||
cargo install --path ../loco-cli | ||
- name: Run cargo test | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
args: --all-features |
Oops, something went wrong.