From 8d51d14fee73a031fcbee732be0189a541afa07c Mon Sep 17 00:00:00 2001 From: "Dotan J. Nahum" Date: Tue, 22 Oct 2024 19:22:26 +0300 Subject: [PATCH] ci: more readable jobs (#897) * ci: more readable jobs --- .github/workflows/ci-example.yml | 98 ------- .github/workflows/ci-generators.yml | 263 ------------------ .github/workflows/ci-loco-gen.yml | 83 ------ .../ci-starter-lightweight-service.yml | 100 ------- .github/workflows/ci-starter-rest-api.yml | 134 --------- .github/workflows/ci-starter-saas.yml | 162 ----------- .github/workflows/ci.yml | 76 ----- .github/workflows/docs.yml | 7 +- .github/workflows/e2e-cli-master.yaml | 109 -------- .github/workflows/e2e.yaml | 66 ----- .github/workflows/loco-cli.yml | 24 +- 11 files changed, 6 insertions(+), 1116 deletions(-) delete mode 100644 .github/workflows/ci-example.yml delete mode 100644 .github/workflows/ci-generators.yml delete mode 100644 .github/workflows/ci-loco-gen.yml delete mode 100644 .github/workflows/ci-starter-lightweight-service.yml delete mode 100644 .github/workflows/ci-starter-rest-api.yml delete mode 100644 .github/workflows/ci-starter-saas.yml delete mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/e2e-cli-master.yaml delete mode 100644 .github/workflows/e2e.yaml diff --git a/.github/workflows/ci-example.yml b/.github/workflows/ci-example.yml deleted file mode 100644 index d88c008ef..000000000 --- a/.github/workflows/ci-example.yml +++ /dev/null @@ -1,98 +0,0 @@ -name: examples/demo - -on: - push: - branches: - - master - pull_request: - -env: - RUST_TOOLCHAIN: stable - TOOLCHAIN_PROFILE: minimal - -jobs: - rustfmt: - name: Check 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 - - run: cargo fmt --all -- --check - working-directory: ./examples/demo - - clippy: - name: Run 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 - - 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: - name: Run Tests - 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 diff --git a/.github/workflows/ci-generators.yml b/.github/workflows/ci-generators.yml deleted file mode 100644 index c543f25e4..000000000 --- a/.github/workflows/ci-generators.yml +++ /dev/null @@ -1,263 +0,0 @@ -name: ci-generators - -on: - push: - branches: - - master - pull_request: - -env: - RUST_TOOLCHAIN: stable - TOOLCHAIN_PROFILE: minimal - -jobs: - test: - name: Run Tests - 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: scaffold - run: cargo run -- generate scaffold --htmx car name:string year:int && cargo build - working-directory: ./examples/demo - env: - REDIS_URL: redis://localhost:${{job.services.redis.ports[6379]}} - DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres_test - - - name: model - run: cargo run -- generate model post title:string content:text && cargo build - working-directory: ./examples/demo - env: - REDIS_URL: redis://localhost:${{job.services.redis.ports[6379]}} - DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres_test - - - name: controller - run: cargo run -- generate controller pages about --htmx && cargo build && cargo test pages - working-directory: ./examples/demo - env: - REDIS_URL: redis://localhost:${{job.services.redis.ports[6379]}} - DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres_test - - - name: worker - run: cargo run -- generate worker report_worker && cargo build && cargo test workers::report_worker::test_run_report_worker_worker - working-directory: ./examples/demo - env: - REDIS_URL: redis://localhost:${{job.services.redis.ports[6379]}} - DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres_test - - - name: mailer - run: cargo run -- generate mailer birthday_mailer && cargo build - working-directory: ./examples/demo - env: - REDIS_URL: redis://localhost:${{job.services.redis.ports[6379]}} - DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres_test - - - name: task - run: cargo run -- generate task mytask && cargo build && cargo test tasks::mytask::test_can_run_mytask - working-directory: ./examples/demo - env: - REDIS_URL: redis://localhost:${{job.services.redis.ports[6379]}} - DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres_test - - - name: scheduler - run: cargo run -- generate scheduler - working-directory: ./examples/demo - env: - REDIS_URL: redis://localhost:${{job.services.redis.ports[6379]}} - DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres_test - - - name: docker deployment - run: cargo run -- generate deployment - working-directory: ./examples/demo - env: - LOCO_DEPLOYMENT_KIND: docker - REDIS_URL: redis://localhost:${{job.services.redis.ports[6379]}} - DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres_test - - model_fields_generator: - name: Run Tests - runs-on: ubuntu-latest - strategy: - matrix: - db: - - "postgres://postgres:postgres@localhost:5432/postgres_test" - # XXX: need to clean up demo first - # - "sqlite://loco_app.sqlite?mode=rwc" - - 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: test ${{ matrix.field_type }} model field type - run: | - cargo run -- generate model post \ - uuid_uniq:uuid \ - uuid_null:uuid_col \ - uuid:uuid_col! \ - string_null:string \ - string:string! \ - string_uniq:string^ \ - text_null:text \ - text:text! \ - tiny_integer_null:tiny_int \ - tiny_integer:tiny_int! \ - tiny_integer_uniq:tiny_int^ \ - small_integer_null:small_int \ - small_integer:small_int! \ - small_integer_uniq:small_int^ \ - integer_null:int \ - integer:int! \ - integer_uniq:int^ \ - big_integer_null:big_int \ - big_integer:big_int! \ - big_integer_uniq:big_int^ \ - float_null:float \ - float:float! \ - double_null:double \ - double:double! \ - decimal_null:decimal \ - decimal:decimal! \ - decimal_len_null:decimal_len \ - decimal_len:decimal_len! \ - boolean_null:bool \ - boolean:bool! \ - timestamp_with_time_zone_null:tstz \ - timestamp_with_time_zone:tstz! \ - date_null:date \ - date:date! \ - timestamp_null:ts \ - timestamp:ts! \ - json_null:json \ - json:json! \ - json_binary_null:jsonb \ - json_binary:jsonb! \ - blob_null:blob \ - blob:blob! \ - money_null:money \ - money:money! \ - && cargo build - working-directory: ./examples/demo - env: - REDIS_URL: redis://localhost:${{job.services.redis.ports[6379]}} - DATABASE_URL: ${{matrix.db}} - - - name: test ${{ matrix.field_type }} scaffold field type - run: | - cargo run -- generate scaffold --api room \ - uuid_uniq:uuid \ - uuid_null:uuid_col \ - uuid:uuid_col! \ - string_null:string \ - string:string! \ - string_uniq:string^ \ - text_null:text \ - text:text! \ - tiny_integer_null:tiny_int \ - tiny_integer:tiny_int! \ - tiny_integer_uniq:tiny_int^ \ - small_integer_null:small_int \ - small_integer:small_int! \ - small_integer_uniq:small_int^ \ - integer_null:int \ - integer:int! \ - integer_uniq:int^ \ - big_integer_null:big_int \ - big_integer:big_int! \ - big_integer_uniq:big_int^ \ - float_null:float \ - float:float! \ - double_null:double \ - double:double! \ - decimal_null:decimal \ - decimal:decimal! \ - decimal_len_null:decimal_len \ - decimal_len:decimal_len! \ - boolean_null:bool \ - boolean:bool! \ - timestamp_with_time_zone_null:tstz \ - timestamp_with_time_zone:tstz! \ - date_null:date \ - date:date! \ - timestamp_null:ts \ - timestamp:ts! \ - json_null:json \ - json:json! \ - json_binary_null:jsonb \ - json_binary:jsonb! \ - && cargo build - working-directory: ./examples/demo - env: - REDIS_URL: redis://localhost:${{job.services.redis.ports[6379]}} - DATABASE_URL: ${{matrix.db}} diff --git a/.github/workflows/ci-loco-gen.yml b/.github/workflows/ci-loco-gen.yml deleted file mode 100644 index 940abbf5d..000000000 --- a/.github/workflows/ci-loco-gen.yml +++ /dev/null @@ -1,83 +0,0 @@ -name: CI/loco-gen - -on: - push: - branches: - - master - pull_request: - -env: - RUST_TOOLCHAIN: stable - TOOLCHAIN_PROFILE: minimal - -defaults: - run: - working-directory: ./loco-gen - -jobs: - rustfmt: - name: Check 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: Run cargo fmt - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check - - clippy: - name: Run 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 - - 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: - name: Run Tests - 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 diff --git a/.github/workflows/ci-starter-lightweight-service.yml b/.github/workflows/ci-starter-lightweight-service.yml deleted file mode 100644 index 4e98bb104..000000000 --- a/.github/workflows/ci-starter-lightweight-service.yml +++ /dev/null @@ -1,100 +0,0 @@ -name: starters/lightweight-service - -on: - push: - branches: - - master - paths: - - starters/lightweight-service/** - pull_request: - paths: - - starters/lightweight-service/** - -env: - RUST_TOOLCHAIN: stable - TOOLCHAIN_PROFILE: minimal - -jobs: - rustfmt: - name: Check 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 - - run: cargo fmt --all -- --check - working-directory: ./starters/lightweight-service - - clippy: - name: Run 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 - - name: Run cargo clippy - run: cargo clippy -- -W clippy::nursery -W clippy::pedantic -W rust-2018-idioms -W rust-2021-compatibility - working-directory: ./starters/lightweight-service - - test: - name: Run Tests - 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 - - name: Run cargo test - run: cargo test --all-features --all - working-directory: ./starters/lightweight-service - - # generate_template: - # name: Generate Template - # needs: [test] - # 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 - # - name: Inject slug/short variables - # uses: rlespinasse/github-slug-action@v3.x - # - name: Generate template - # run: | - # cargo build --release --features github_ci - # RUST_LOG=debug LOCO_CURRENT_REPOSITORY=${{ github.event.pull_request.head.repo.html_url }} LOCO_CI_MODE=true LOCO_APP_NAME=stateless_html_starter LOCO_TEMPLATE=stateless_html LOCO_BRANCH=${{ env.GITHUB_HEAD_REF_SLUG }} ./target/release/loco new - # cd stateless_html_starter - # echo "Building generate template..." - # cargo build --release - # echo "Run cargo test on generated template..." - # cargo test - # working-directory: ./loco-cli diff --git a/.github/workflows/ci-starter-rest-api.yml b/.github/workflows/ci-starter-rest-api.yml deleted file mode 100644 index b17b69d69..000000000 --- a/.github/workflows/ci-starter-rest-api.yml +++ /dev/null @@ -1,134 +0,0 @@ -name: starters/rest-api - -on: - push: - branches: - - master - paths: - - starters/rest-api/** - pull_request: - paths: - - starters/rest-api/** - -env: - RUST_TOOLCHAIN: stable - TOOLCHAIN_PROFILE: minimal - -jobs: - rustfmt: - name: Check 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 - - run: cargo fmt --all -- --check - working-directory: ./starters/rest-api - - clippy: - name: Run 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 - - name: Run cargo clippy - run: cargo clippy -- -W clippy::nursery -W clippy::pedantic -W rust-2018-idioms -W rust-2021-compatibility - working-directory: ./starters/rest-api - - test: - name: Run Tests - needs: [rustfmt, clippy] - runs-on: ubuntu-latest - strategy: - matrix: - db: - - "postgres://postgres:postgres@localhost:5432/postgres_test" - - "sqlite://loco_app.sqlite?mode=rwc" - - 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 loco db reset && cargo loco db entities && cargo test --all-features --all - working-directory: ./starters/rest-api - env: - REDIS_URL: redis://localhost:${{job.services.redis.ports[6379]}} - DATABASE_URL: ${{matrix.db}} - # generate_template: - # name: Generate Template - # needs: [test] - # 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 - # - name: Inject slug/short variables - # uses: rlespinasse/github-slug-action@v3.x - # - name: Generate template - # run: | - # cargo build --release --features github_ci - # RUST_LOG=debug LOCO_CURRENT_REPOSITORY=${{ github.event.pull_request.head.repo.html_url }} LOCO_CI_MODE=true LOCO_APP_NAME=stateless_starter LOCO_TEMPLATE=stateless LOCO_BRANCH=${{ env.GITHUB_HEAD_REF_SLUG }} ./target/release/loco new - # cd stateless_starter - # echo "Building generate template..." - # cargo build --release - # echo "Run cargo test on generated template..." - # cargo test - # working-directory: ./loco-cli diff --git a/.github/workflows/ci-starter-saas.yml b/.github/workflows/ci-starter-saas.yml deleted file mode 100644 index 60e5c49c9..000000000 --- a/.github/workflows/ci-starter-saas.yml +++ /dev/null @@ -1,162 +0,0 @@ -name: starters/saas - -on: - push: - branches: - - master - paths: - - starters/saas/** - pull_request: - paths: - - starters/saas/** - -env: - RUST_TOOLCHAIN: stable - TOOLCHAIN_PROFILE: minimal - -jobs: - rustfmt: - name: Check 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 - - run: cargo fmt --all -- --check - working-directory: ./starters/saas - - clippy: - name: Run 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 - - name: Run cargo clippy - run: cargo clippy -- -W clippy::nursery -W clippy::pedantic -W rust-2018-idioms -W rust-2021-compatibility - working-directory: ./starters/saas - - test: - name: Run Tests - needs: [rustfmt, clippy] - runs-on: ubuntu-latest - strategy: - matrix: - db: - - "postgres://postgres:postgres@localhost:5432/postgres_test" - - "sqlite://loco_app.sqlite?mode=rwc" - - 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 loco db reset && cargo loco db entities && cargo test --all-features --all - working-directory: ./starters/saas - env: - REDIS_URL: redis://localhost:${{job.services.redis.ports[6379]}} - DATABASE_URL: ${{matrix.db}} - - # generate_template: - # name: Generate Template - # needs: [test] - # 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: Inject slug/short variables - # uses: rlespinasse/github-slug-action@v3.x - # - name: Generate template - # run: | - # cargo build --release --features github_ci - # RUST_LOG=debug LOCO_CURRENT_REPOSITORY=${{ github.event.pull_request.head.repo.html_url }} LOCO_CI_MODE=true LOCO_APP_NAME=saas_starter LOCO_TEMPLATE=saas LOCO_BRANCH=${{ env.GITHUB_HEAD_REF_SLUG }} ./target/release/loco new - # cd saas_starter - # echo "Building generate template..." - # cargo build --release - # echo "Run cargo test on generated template..." - # cargo test - # working-directory: ./loco-cli - # env: - # APP_REDIS_URI: redis://localhost:${{job.services.redis.ports[6379]}} - # APP_DATABASE_URI: postgres://postgres:postgres@localhost:5432/postgres_test diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 955fec3d4..000000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,76 +0,0 @@ -name: CI - -on: - push: - branches: - - master - pull_request: - -env: - RUST_TOOLCHAIN: stable - TOOLCHAIN_PROFILE: minimal - -jobs: - rustfmt: - name: Check 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: Run cargo fmt - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check - - clippy: - name: Run 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 - - 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: - name: Run Tests - 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 - - - name: Run cargo test - uses: actions-rs/cargo@v1 - with: - command: test - args: --all-features --workspace --exclude loco-gen diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 25d49293c..d2cae9c59 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,4 +1,4 @@ -name: docs +name: "[docs]" on: push: @@ -12,7 +12,6 @@ env: jobs: check: - name: Check runs-on: ubuntu-latest permissions: @@ -25,8 +24,6 @@ jobs: with: toolchain: ${{ env.RUST_TOOLCHAIN }} - run: cargo install snipdoc --features exec - - run: snipdoc check + - run: snipdoc check env: SNIPDOC_SKIP_EXEC_COMMANDS: true - - \ No newline at end of file diff --git a/.github/workflows/e2e-cli-master.yaml b/.github/workflows/e2e-cli-master.yaml deleted file mode 100644 index 1cf402e1f..000000000 --- a/.github/workflows/e2e-cli-master.yaml +++ /dev/null @@ -1,109 +0,0 @@ -name: e2e-cli-master - -on: - push: - branches: - - master - pull_request: - -jobs: - # TODO: re-enable after 0.8 to check cmd spawning fix - saas-template-win32: - name: Create 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-template: - name: Create 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: - name: Create 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: - name: Create 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 diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml deleted file mode 100644 index 0431fb66b..000000000 --- a/.github/workflows/e2e.yaml +++ /dev/null @@ -1,66 +0,0 @@ -name: e2e - -on: - schedule: - - cron: 0 * * * * # every hour - -jobs: - saas-template: - name: Create saas starter template - 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: - name: Create stateless starter template - 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: - name: Create stateless starter template - 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 diff --git a/.github/workflows/loco-cli.yml b/.github/workflows/loco-cli.yml index dd089887a..786beb9a3 100644 --- a/.github/workflows/loco-cli.yml +++ b/.github/workflows/loco-cli.yml @@ -1,4 +1,4 @@ -name: loco-cli +name: "[loco-cli:ci]" on: push: @@ -11,8 +11,7 @@ env: TOOLCHAIN_PROFILE: minimal jobs: - rustfmt: - name: Check Style + style: runs-on: ubuntu-latest permissions: @@ -25,30 +24,15 @@ jobs: with: toolchain: ${{ env.RUST_TOOLCHAIN }} components: rustfmt - - run: cargo fmt --all -- --check - working-directory: ./loco-cli - - clippy: - name: Run 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 fmt --all -- --check + working-directory: ./loco-cli - name: Run cargo clippy run: cargo clippy --all-features -- -D warnings -W clippy::pedantic -W clippy::nursery -W rust-2018-idioms working-directory: ./loco-cli test: - name: Run Tests needs: [rustfmt, clippy] runs-on: ${{ matrix.os }} strategy: