From b1a5993c57131b7b0300a1b0002427b7915be7b1 Mon Sep 17 00:00:00 2001 From: Hamir Mahal Date: Tue, 8 Oct 2024 15:57:53 -0700 Subject: [PATCH 1/2] chore: changes from formatting on save --- .github/workflows/tests.yaml | 464 +++++++++++++++++------------------ 1 file changed, 232 insertions(+), 232 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 01f62015..c97eb6e6 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -1,236 +1,236 @@ name: tests -'on': - pull_request: - paths-ignore: - - '**.md' - - .github/ISSUE_TEMPLATE/** - push: - paths-ignore: - - '**.md' - - .github/ISSUE_TEMPLATE/** - branches: - - main - - pr/**/ci +"on": + pull_request: + paths-ignore: + - "**.md" + - .github/ISSUE_TEMPLATE/** + push: + paths-ignore: + - "**.md" + - .github/ISSUE_TEMPLATE/** + branches: + - main + - pr/**/ci concurrency: - group: '${{ github.workflow }}-${{ github.head_ref || github.ref || github.run_id }}' - cancel-in-progress: true + group: "${{ github.workflow }}-${{ github.head_ref || github.ref || github.run_id }}" + cancel-in-progress: true env: - CARGO_TERM_COLOR: always + CARGO_TERM_COLOR: always jobs: - check: - name: Check - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - - uses: actions-rs/cargo@v1 - with: - command: check - test: - name: Test - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - - uses: actions-rs/cargo@v1 - with: - command: test - args: '--workspace' - fmt: - name: Rustfmt - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@master - with: - toolchain: stable - components: rustfmt - - run: cargo fmt --all -- --check - clippy: - name: Clippy - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@master - with: - toolchain: stable - components: clippy - - run: cargo clippy --all -- -D warnings - integration-sqlite: - name: SQLite integration tests - runs-on: ubuntu-latest - needs: - - check - - test - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@stable - - name: Install sea-orm-cli - uses: baptiste0928/cargo-install@v2 - with: - crate: sea-orm-cli - version: 1.0.0 - - name: Remove generated folder - run: rm -rf ./examples/sqlite/src - - name: Copy sample database - run: cp ./examples/sqlite/sakila.db . - - name: Generate entities - run: >- - sea-orm-cli generate entity -o examples/sqlite/src/entities -u - sqlite://sakila.db --seaography - - name: Generate Seaography project - uses: actions-rs/cargo@v1 - with: - command: run - args: > - --package seaography-cli -- ./examples/sqlite - ./examples/sqlite/src/entities sqlite://sakila.db - seaography-sqlite-example -f actix - - name: Depends on local seaography - run: >- - sed -i '/^\[dependencies.seaography\]$/a \path = "..\/..\/"' - ./examples/sqlite/Cargo.toml - - name: Build example - working-directory: ./examples/sqlite - run: cargo build - - name: Integration tests - working-directory: ./examples/sqlite - run: cargo test - integration-mysql: - name: MySQL integration tests - runs-on: ubuntu-latest - needs: - - check - - test - services: - mysql: - image: 'mysql:8.0' - env: - MYSQL_HOST: 127.0.0.1 - MYSQL_DB: mysql - MYSQL_USER: sea - MYSQL_PASSWORD: sea - MYSQL_ALLOW_EMPTY_PASSWORD: 'yes' - MYSQL_ROOT_PASSWORD: '' - ports: - - '3306:3306' - options: >- - --health-cmd="mysqladmin ping" --health-interval=10s - --health-timeout=5s --health-retries=3 - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@stable - - name: Install sea-orm-cli - uses: baptiste0928/cargo-install@v2 - with: - crate: sea-orm-cli - version: 1.0.0 - - name: Remove generated folder - run: rm -rf ./examples/mysql/src - - name: Create DB - run: mysql -uroot -h 127.0.0.1 mysql -e 'CREATE DATABASE `sakila`' - - name: Grant Privilege - run: >- - mysql -uroot -h 127.0.0.1 mysql -e "GRANT ALL PRIVILEGES ON *.* TO - 'sea'@'%'" - - name: Import DB Schema - run: mysql -uroot -h 127.0.0.1 sakila < sakila-schema.sql - working-directory: ./examples/mysql - - name: Import DB Data - run: mysql -uroot -h 127.0.0.1 sakila < sakila-data.sql - working-directory: ./examples/mysql - - name: Generate entities - run: >- - sea-orm-cli generate entity -o ./examples/mysql/src/entities -u - mysql://sea:sea@127.0.0.1/sakila --seaography - - name: Generate Seaography project - uses: actions-rs/cargo@v1 - with: - command: run - args: > - --package seaography-cli -- ./examples/mysql - ./examples/mysql/src/entities mysql://sea:sea@127.0.0.1/sakila - seaography-mysql-example -f axum - - name: Depends on local seaography - run: >- - sed -i '/^\[dependencies.seaography\]$/a \path = "..\/..\/"' - ./examples/mysql/Cargo.toml - - name: Fix Nullable not implemented for Vec and tsvector - run: 'sed -i "24,28d" ./examples/mysql/src/entities/film.rs' - - name: Build example - working-directory: ./examples/mysql - run: cargo build - - name: Integration tests - working-directory: ./examples/mysql - run: cargo test - integration-postgres: - name: Postgres integration tests - runs-on: ubuntu-latest - needs: - - check - - test - services: - mysql: - image: 'postgres:14.4' - env: - POSTGRES_HOST: 127.0.0.1 - POSTGRES_USER: sea - POSTGRES_PASSWORD: sea - ports: - - '5432:5432' - options: >- - --health-cmd pg_isready --health-interval 10s --health-timeout 5s - --health-retries 5 - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@stable - - name: Install sea-orm-cli - uses: baptiste0928/cargo-install@v2 - with: - crate: sea-orm-cli - version: 1.0.0 - - name: Remove generated folder - run: rm -rf ./examples/postgres/src - - name: Create DB - run: >- - psql -q postgres://sea:sea@localhost/postgres -c 'CREATE DATABASE - "sakila"' - - name: Import DB Schema - run: 'psql -q postgres://sea:sea@localhost/sakila < sakila-schema.sql' - working-directory: ./examples/postgres - - name: Import DB Data - run: 'psql -q postgres://sea:sea@localhost/sakila < sakila-data.sql' - working-directory: ./examples/postgres - - name: Generate entities - run: >- - sea-orm-cli generate entity -o ./examples/postgres/src/entities -u - postgres://sea:sea@127.0.0.1/sakila?currentSchema=public --seaography - - name: Generate Seaography project - uses: actions-rs/cargo@v1 - with: - command: run - args: > - --package seaography-cli -- ./examples/postgres - ./examples/postgres/src/entities - postgres://sea:sea@127.0.0.1/sakila?currentSchema=public - seaography-postgres-example -f poem - - name: Depends on local seaography - run: >- - sed -i '/^\[dependencies.seaography\]$/a \path = "..\/..\/"' - ./examples/postgres/Cargo.toml - - name: Fix Nullable not implemented for Vec and tsvector - run: 'sed -i "26,27d" ./examples/postgres/src/entities/film.rs' - - name: Build example - working-directory: ./examples/postgres - run: cargo build - - name: Integration tests - working-directory: ./examples/postgres - run: cargo test + check: + name: Check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + - uses: actions-rs/cargo@v1 + with: + command: check + test: + name: Test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + - uses: actions-rs/cargo@v1 + with: + command: test + args: "--workspace" + fmt: + name: Rustfmt + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + components: rustfmt + - run: cargo fmt --all -- --check + clippy: + name: Clippy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + components: clippy + - run: cargo clippy --all -- -D warnings + integration-sqlite: + name: SQLite integration tests + runs-on: ubuntu-latest + needs: + - check + - test + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + - name: Install sea-orm-cli + uses: baptiste0928/cargo-install@v2 + with: + crate: sea-orm-cli + version: 1.0.0 + - name: Remove generated folder + run: rm -rf ./examples/sqlite/src + - name: Copy sample database + run: cp ./examples/sqlite/sakila.db . + - name: Generate entities + run: >- + sea-orm-cli generate entity -o examples/sqlite/src/entities -u + sqlite://sakila.db --seaography + - name: Generate Seaography project + uses: actions-rs/cargo@v1 + with: + command: run + args: > + --package seaography-cli -- ./examples/sqlite + ./examples/sqlite/src/entities sqlite://sakila.db + seaography-sqlite-example -f actix + - name: Depends on local seaography + run: >- + sed -i '/^\[dependencies.seaography\]$/a \path = "..\/..\/"' + ./examples/sqlite/Cargo.toml + - name: Build example + working-directory: ./examples/sqlite + run: cargo build + - name: Integration tests + working-directory: ./examples/sqlite + run: cargo test + integration-mysql: + name: MySQL integration tests + runs-on: ubuntu-latest + needs: + - check + - test + services: + mysql: + image: "mysql:8.0" + env: + MYSQL_HOST: 127.0.0.1 + MYSQL_DB: mysql + MYSQL_USER: sea + MYSQL_PASSWORD: sea + MYSQL_ALLOW_EMPTY_PASSWORD: "yes" + MYSQL_ROOT_PASSWORD: "" + ports: + - "3306:3306" + options: >- + --health-cmd="mysqladmin ping" --health-interval=10s + --health-timeout=5s --health-retries=3 + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + - name: Install sea-orm-cli + uses: baptiste0928/cargo-install@v2 + with: + crate: sea-orm-cli + version: 1.0.0 + - name: Remove generated folder + run: rm -rf ./examples/mysql/src + - name: Create DB + run: mysql -uroot -h 127.0.0.1 mysql -e 'CREATE DATABASE `sakila`' + - name: Grant Privilege + run: >- + mysql -uroot -h 127.0.0.1 mysql -e "GRANT ALL PRIVILEGES ON *.* TO + 'sea'@'%'" + - name: Import DB Schema + run: mysql -uroot -h 127.0.0.1 sakila < sakila-schema.sql + working-directory: ./examples/mysql + - name: Import DB Data + run: mysql -uroot -h 127.0.0.1 sakila < sakila-data.sql + working-directory: ./examples/mysql + - name: Generate entities + run: >- + sea-orm-cli generate entity -o ./examples/mysql/src/entities -u + mysql://sea:sea@127.0.0.1/sakila --seaography + - name: Generate Seaography project + uses: actions-rs/cargo@v1 + with: + command: run + args: > + --package seaography-cli -- ./examples/mysql + ./examples/mysql/src/entities mysql://sea:sea@127.0.0.1/sakila + seaography-mysql-example -f axum + - name: Depends on local seaography + run: >- + sed -i '/^\[dependencies.seaography\]$/a \path = "..\/..\/"' + ./examples/mysql/Cargo.toml + - name: Fix Nullable not implemented for Vec and tsvector + run: 'sed -i "24,28d" ./examples/mysql/src/entities/film.rs' + - name: Build example + working-directory: ./examples/mysql + run: cargo build + - name: Integration tests + working-directory: ./examples/mysql + run: cargo test + integration-postgres: + name: Postgres integration tests + runs-on: ubuntu-latest + needs: + - check + - test + services: + mysql: + image: "postgres:14.4" + env: + POSTGRES_HOST: 127.0.0.1 + POSTGRES_USER: sea + POSTGRES_PASSWORD: sea + ports: + - "5432:5432" + options: >- + --health-cmd pg_isready --health-interval 10s --health-timeout 5s + --health-retries 5 + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + - name: Install sea-orm-cli + uses: baptiste0928/cargo-install@v2 + with: + crate: sea-orm-cli + version: 1.0.0 + - name: Remove generated folder + run: rm -rf ./examples/postgres/src + - name: Create DB + run: >- + psql -q postgres://sea:sea@localhost/postgres -c 'CREATE DATABASE + "sakila"' + - name: Import DB Schema + run: "psql -q postgres://sea:sea@localhost/sakila < sakila-schema.sql" + working-directory: ./examples/postgres + - name: Import DB Data + run: "psql -q postgres://sea:sea@localhost/sakila < sakila-data.sql" + working-directory: ./examples/postgres + - name: Generate entities + run: >- + sea-orm-cli generate entity -o ./examples/postgres/src/entities -u + postgres://sea:sea@127.0.0.1/sakila?currentSchema=public --seaography + - name: Generate Seaography project + uses: actions-rs/cargo@v1 + with: + command: run + args: > + --package seaography-cli -- ./examples/postgres + ./examples/postgres/src/entities + postgres://sea:sea@127.0.0.1/sakila?currentSchema=public + seaography-postgres-example -f poem + - name: Depends on local seaography + run: >- + sed -i '/^\[dependencies.seaography\]$/a \path = "..\/..\/"' + ./examples/postgres/Cargo.toml + - name: Fix Nullable not implemented for Vec and tsvector + run: 'sed -i "26,27d" ./examples/postgres/src/entities/film.rs' + - name: Build example + working-directory: ./examples/postgres + run: cargo build + - name: Integration tests + working-directory: ./examples/postgres + run: cargo test From 3113632fe413e20babde2e21a49d4bd5c50ba6cd Mon Sep 17 00:00:00 2001 From: Hamir Mahal Date: Tue, 8 Oct 2024 15:58:30 -0700 Subject: [PATCH 2/2] fix: usage of `node12 which is deprecated` --- .github/workflows/tests.yaml | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index c97eb6e6..f0643d6a 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -22,28 +22,13 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - - uses: actions-rs/cargo@v1 - with: - command: check + - run: cargo check --all --all-features --all-targets test: name: Test runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - - uses: actions-rs/cargo@v1 - with: - command: test - args: "--workspace" + - run: cargo test --workspace fmt: name: Rustfmt runs-on: ubuntu-latest