From c90d0d07853b7ce10b71e21c9e5ad3fa2f5e08fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BC=8A=E6=AC=A7?= Date: Tue, 24 Oct 2023 09:44:50 +0800 Subject: [PATCH] ci: Add wasi target. --- .github/workflows/rust.yml | 47 +++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 6e3a523bd..4c8ea2cef 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -1,15 +1,15 @@ # GitHub Actions with Conditional Job Running Based on Commit Message -# +# # -------------------------------------------------------------------------------- -# +# # Following jobs will always run -# +# # - `clippy` # - `test` # - `examples` -# +# # Following jobs will be run when no keywords were found in commit message) -# +# # - `compile-sqlite` # - `sqlite` # - `compile-mysql` @@ -17,37 +17,36 @@ # - `mariadb` # - `compile-postgres` # - `postgres` -# +# # Following jobs will be run if keywords `[issues]` were found in commit message -# +# # - Jobs that will always run # - `issues` -# +# # Following jobs will be run if keywords `[cli]` were found in commit message -# +# # - Jobs that will always run # - `cli` -# +# # Following jobs will be run if keywords `[sqlite]` were found in commit message -# +# # - Jobs that will always run # - `compile-sqlite` # - `sqlite` -# +# # Following jobs will be run if keywords `[mysql]` were found in commit message -# +# # - Jobs that will always run # - `compile-mysql` # - `mysql` # - `mariadb` -# +# # Following jobs will be run if keywords `[postgres]` were found in commit message -# +# # - Jobs that will always run # - `compile-postgres` # - `postgres` - name: tests on: @@ -73,7 +72,6 @@ env: CARGO_TERM_COLOR: always jobs: - init: name: Init runs-on: ubuntu-latest @@ -252,6 +250,7 @@ jobs: with: toolchain: nightly components: rustfmt + - run: rustup target add wasm32-wasi - run: find ${{ matrix.path }} -type f -name 'Cargo.toml' -print0 | xargs -t -0 -I {} cargo fmt --manifest-path {} -- --check - uses: dtolnay/rust-toolchain@stable - run: find ${{ matrix.path }} -type f -name 'Cargo.toml' -print0 | xargs -t -0 -I {} cargo build --manifest-path {} @@ -299,7 +298,7 @@ jobs: }} runs-on: ubuntu-latest env: - DATABASE_URL: "sqlite::memory:" + DATABASE_URL: 'sqlite::memory:' strategy: fail-fast: false matrix: @@ -331,7 +330,7 @@ jobs: }} runs-on: ubuntu-latest env: - DATABASE_URL: "mysql://root:@localhost" + DATABASE_URL: 'mysql://root:@localhost' strategy: fail-fast: false matrix: @@ -349,7 +348,7 @@ jobs: MYSQL_ALLOW_EMPTY_PASSWORD: yes MYSQL_ROOT_PASSWORD: ports: - - "3306:3306" + - '3306:3306' options: >- --health-cmd="mysqladmin ping" --health-interval=10s @@ -381,7 +380,7 @@ jobs: }} runs-on: ubuntu-latest env: - DATABASE_URL: "mysql://root:@localhost" + DATABASE_URL: 'mysql://root:@localhost' strategy: fail-fast: false matrix: @@ -399,7 +398,7 @@ jobs: MYSQL_ALLOW_EMPTY_PASSWORD: yes MYSQL_ROOT_PASSWORD: ports: - - "3306:3306" + - '3306:3306' options: >- --health-cmd="mysqladmin ping" --health-interval=10s @@ -430,7 +429,7 @@ jobs: }} runs-on: ubuntu-latest env: - DATABASE_URL: "postgres://root:root@localhost" + DATABASE_URL: 'postgres://root:root@localhost' strategy: fail-fast: false matrix: @@ -445,7 +444,7 @@ jobs: POSTGRES_USER: root POSTGRES_PASSWORD: root ports: - - "5432:5432" + - '5432:5432' options: >- --health-cmd pg_isready --health-interval 10s