Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
shanliu committed Mar 16, 2024
1 parent 1105408 commit 263842f
Show file tree
Hide file tree
Showing 310 changed files with 55,032 additions and 48,344 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* -text
81 changes: 0 additions & 81 deletions .github/workflows/build.yml

This file was deleted.

60 changes: 60 additions & 0 deletions .github/workflows/build_lib_area_php_ext.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: build lsys-lib-area php extension

on:
push:
tags:
- "v*.*.*-php-lib-area-ext"

jobs:
lib_area_windows_x64_php_ext:
runs-on: windows-2019
steps:
- name: Setup MSVC
uses: ilammy/[email protected]
with:
vsversion: 2019
arch: x64

- name: Set Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: Checkout code
uses: actions/checkout@v2

- name: build php 8 extension
run: |
cd ${{ github.workspace }}\server\lsys-lib-area\wrappers\php\ && .\build.cmd init
cd ${{ github.workspace }}\server\lsys-lib-area\wrappers\php\ && .\build.cmd php8
cd ${{ github.workspace }}\server\lsys-lib-area\wrappers\php\ && dir .
- name: package php extension
run: |
cd ${{ github.workspace }} && mkdir server\lsys-lib-area\build\target\example\data
cd ${{ github.workspace }} && powershell -Command "Invoke-WebRequest -Uri 'https://github.com/shanliu/lsys/releases/download/v0.0.0/2023-7-area-code.csv.gz' -OutFile 'server\lsys-lib-area\build\target\example\data\2023-7-area-code.csv.gz'"
cd ${{ github.workspace }} && powershell -Command "Invoke-WebRequest -Uri 'https://github.com/shanliu/lsys/releases/download/v0.0.0/2023-7-area-geo.csv.gz' -OutFile 'server\lsys-lib-area\build\target\example\data\2023-7-area-geo.csv.gz'"
cd ${{ github.workspace }}\server\lsys-lib-area\wrappers\php\ && .\build.cmd archive
cd ${{ github.workspace }}\server\lsys-lib-area\wrappers\php\ && .\build.cmd clear
cd ${{ github.workspace }}\server\lsys-lib-area\wrappers\php\ && mv lsys_lib_area_php_ext.zip ..\..\..\..\
cd ${{ github.workspace }} && powershell -Command "Compress-Archive -Path '.\server\lsys-lib-area\*' -DestinationPath '.\lsys_lib_area_src.zip'"
cd ${{ github.workspace }} && dir .
- name: get current tag
id: get_tag
run: |
$tag = $env:GITHUB_REF -replace 'refs/tags/', ''
Write-Host "##[set-output name=tag;]$tag"
- uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
artifacts: "lsys_lib_area_php_ext.zip,lsys_lib_area_src.zip"
token: ${{ secrets.GITHUB_TOKEN }}
name: ${{ steps.get_tag.outputs.tag }}
prerelease: true
tag: ${{ github.ref }}
body: |
lsys-lib-area crate for php(8.*)扩展,使用vs16(2019)编译
46 changes: 46 additions & 0 deletions .github/workflows/build_lsys.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: build lsys

on:
push:
tags:
- "v*.*.*"
- "!v*.*.*-*"

jobs:
build_for_windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2

- name: set nodejs
uses: actions/setup-node@v3
with:
node-version: 18

- name: set rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: build release
run: ./build.cmd assets zip

- name: get current tag
id: get_tag
run: |
$tag = $env:GITHUB_REF -replace 'refs/tags/', ''
Write-Host "##[set-output name=tag;]$tag"
- uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
artifacts: "lsys-for-windows.zip"
token: ${{ secrets.GITHUB_TOKEN }}
name: ${{ steps.get_tag.outputs.tag }}
prerelease: true
tag: ${{ github.ref }}
body: |
lsys for windows x64 下编译版本请下载 lsys-for-windows.zip
其他系统请下载源码`Source code`编译
58 changes: 58 additions & 0 deletions .github/workflows/check_server.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: check lsys server

on:
push:
branches: [ "main" ]
paths:
- 'server/**/*'
- '!server/**/*.md'
- '!server/**/*.MD'
- '!server/**/*.cmd'
- '!server/**/.gitignore'
- '.github/workflows/check_server.yml'

env:
CARGO_TERM_COLOR: always

jobs:

server_check:
runs-on: ubuntu-latest
services:
redis:
image: redis
ports:
- 6379:6379
options: --entrypoint redis-server
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: "000"
MYSQL_DATABASE: test2
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

steps:

- uses: actions/checkout@v3

- name: init
run: |
cd ${{ github.workspace }}/server && bash ./sql_merge.sh && mysql -h 127.0.0.1 -u root -p000 test2 < ./tables.sql
- name: build server rust
working-directory: ./server
run: cargo build --verbose

- name: init assest
working-directory: ./server/lsys-lib-area
run: |
curl -L -o "./data/2023-7-area-code.csv.gz" "https://github.com/shanliu/lsys/releases/download/v0.0.0/2023-7-area-code.csv.gz"
curl -L -o "./data/2023-7-area-geo.csv.gz" "https://github.com/shanliu/lsys/releases/download/v0.0.0/2023-7-area-geo.csv.gz"
- name: run server rust tests
working-directory: ./server
run: cargo test --verbose


17 changes: 11 additions & 6 deletions .github/workflows/webpack.yml → .github/workflows/check_ui.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
name: NodeJS with Webpack
name: check lsys ui

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
paths:
- 'ui/**/*'
- '!ui/**/*.md'
- '!ui/**/*.MD'
- '!ui/**/*.cmd'
- '!ui/**/.gitignore'
- '.github/workflows/check_ui.yml'

jobs:
build:
ui_check:
runs-on: ubuntu-latest

strategy:
Expand All @@ -17,12 +22,12 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
- name: Use Nodejs
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Build-web
- name: Build ui
working-directory: ./ui
run: |
npm install
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# rust-clippy is a tool that runs a bunch of lints to catch common
# mistakes in your Rust code and help improve your Rust code.
# More details at https://github.com/rust-lang/rust-clippy
# and https://rust-lang.github.io/rust-clippy/

name: rust-clippy analyze
name: rust-clippy server analyze

on:
push:
branches: [ "main" ]
paths:
- 'server/**/*'
- '!server/**/*.md'
- '!server/**/*.MD'
- '!server/**/*.cmd'
- '!server/**/.gitignore'
- '.github/workflows/rust_clippy.yml'

pull_request:
# The branches below must be a subset of the branches above
branches: [ "main" ]
paths:
- 'server/**/*'
- '!server/**/*.md'
- '!server/**/*.MD'
- '!server/**/*.cmd'
- '!server/**/.gitignore'
- '.github/workflows/rust_clippy.yml'

schedule:
- cron: '29 15 * * 4'

jobs:
rust-clippy-analyze:
rust-server-clippy-analyze:
name: Run rust-clippy analyzing
runs-on: ubuntu-latest
permissions:
Expand All @@ -41,16 +47,16 @@ jobs:
- name: Install required cargo
run: cargo install clippy-sarif sarif-fmt

- name: Run rust-clippy
- name: Run server rust-clippy
working-directory: ./server
run:
cargo clippy
--all-features
--message-format=json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt
continue-on-error: true

- name: Upload analysis results to GitHub
- name: Upload server analysis results to GitHub
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: ./server/rust-clippy-results.sarif
wait-for-processing: true
wait-for-processing: true
30 changes: 0 additions & 30 deletions .github/workflows/rust.yml

This file was deleted.

Loading

0 comments on commit 263842f

Please sign in to comment.