From 45cefd2c33c0883934ff9f9c0e7b6ccbaac88c3f Mon Sep 17 00:00:00 2001 From: zyr17 Date: Tue, 13 Feb 2024 18:51:44 +0800 Subject: [PATCH] Ci fix (#52) --- .github/workflows/ci.yml | 3 +++ .github/workflows/debugci.yml | 3 ++- .github/workflows/macos.yml | 9 +++++++++ .github/workflows/windows.yml | 12 ++++++++++++ CMakeLists.txt | 3 ++- src/algo.cpp | 2 +- 6 files changed, 29 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2db31cc..c1ea4f4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,12 +25,15 @@ jobs: uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} + - name: Install mingw + run: choco install mingw --Version 8.1.0 - name: npm run: | npm ci npm run-script package-win - name: cmake run: | + $env:Path = "C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin;" + $env:Path git submodule update --init --recursive mkdir bin mkdir bin/release diff --git a/.github/workflows/debugci.yml b/.github/workflows/debugci.yml index 8737014..02fc1ec 100644 --- a/.github/workflows/debugci.yml +++ b/.github/workflows/debugci.yml @@ -24,13 +24,14 @@ jobs: with: node-version: ${{ matrix.node-version }} - name: Install mingw - run: choco install mingw --Version 11.4.0 + run: choco install mingw --Version 8.1.0 - name: npm run: | npm ci npm run-script package-win - name: cmake run: | + $env:Path = "C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin;" + $env:Path git submodule update --init --recursive mkdir bin mkdir bin/debug diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 71ffe9e..f81f0ac 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -50,7 +50,16 @@ jobs: run: | brew install p7zip 7z a MajsoulPaipuAnalyzer-macos-x64.7z MajsoulPaipuAnalyzer-macos-x64 -m0=LZMA2 -mmt + - uses: actions/upload-artifact@v2 + with: + name: MajsoulPaipuAnalyzer-macos-x64.7z + path: MajsoulPaipuAnalyzer-macos-x64.7z + - uses: actions/upload-artifact@v2 + with: + name: PaipuAnalyzer + path: bin/release/PaipuAnalyzer - name: Upload to release + if: github.event_name != 'workflow_dispatch' run: | cp .github/asset.js . node asset.js ${{ secrets.ACCESS_TOKEN }} $GITHUB_EVENT_PATH $GITHUB_REPOSITORY MajsoulPaipuAnalyzer-macos-x64.7z application/octet_stream \ No newline at end of file diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 6b6b7fa..261cf63 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -23,12 +23,15 @@ jobs: uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} + - name: Install mingw + run: choco install mingw --Version 8.1.0 - name: npm run: | npm ci npm run-script package-win - name: cmake run: | + $env:Path = "C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin;" + $env:Path git submodule update --init --recursive mkdir bin mkdir bin/release @@ -48,7 +51,16 @@ jobs: mv result MajsoulPaipuAnalyzer-win-x64 - name: archive run: 7z a MajsoulPaipuAnalyzer-win-x64.7z MajsoulPaipuAnalyzer-win-x64 -m0=LZMA2 -mmt + - uses: actions/upload-artifact@v2 + with: + name: MajsoulPaipuAnalyzer-win-x64.7z + path: MajsoulPaipuAnalyzer-win-x64.7z + - uses: actions/upload-artifact@v2 + with: + name: PaipuAnalyzer + path: bin/release/PaipuAnalyzer.exe - name: Upload to release + if: github.event_name != 'workflow_dispatch' run: | echo $GITHUB_EVENT_PATH $GITHUB_REPOSITORY echo $env:GITHUB_EVENT_PATH $env:GITHUB_REPOSITORY diff --git a/CMakeLists.txt b/CMakeLists.txt index 35e6c7e..3402b12 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,11 +7,12 @@ set (CMAKE_C_COMPILER g++) aux_source_directory(./src DIR_MAIN) aux_source_directory(./src/CJsonObject DIR_LIB) add_executable(PaipuAnalyzer ${DIR_MAIN} ${DIR_LIB}) -SET(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -std=c++11 -O0 -Wall -g -ggdb -D DEBUG") IF(APPLE) SET(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -std=c++11 -O3") + SET(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -std=c++11 -O0 -Wall -g -ggdb -D DEBUG") ELSE() SET(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -std=c++11 -O3 -static") + SET(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -std=c++11 -O0 -Wall -g -ggdb -D DEBUG -static") ENDIF() set(FAKE_TARGET fakeTarget) diff --git a/src/algo.cpp b/src/algo.cpp index 39a3db3..0eda4eb 100644 --- a/src/algo.cpp +++ b/src/algo.cpp @@ -768,7 +768,7 @@ namespace SR{ if (roomnumber == INVALIDROOM) roomnumber= 0; } - std::cout << "stablerank " << round << ' ' << roomnumber << std::endl; + // std::cout << "stablerank " << round << ' ' << roomnumber << std::endl; assert(roomnumber == 0 || roomnumber == 100 || (roomnumber >= 0 && roomnumber < ROOMNUMBER && considerroom[roomnumber])); auto &rd = rds[roomnumber]; if (!(rd.pts[0].size())){