From 48cab893c90b46b55e88d7890049fd7cd5888913 Mon Sep 17 00:00:00 2001 From: Lil-Ran Date: Sat, 15 Mar 2025 23:03:15 +0800 Subject: [PATCH] ci: build workflow --- .github/workflows/build.yml | 55 ++++++++++++++++++++++ .github/workflows/codeql-analysis.yml | 67 --------------------------- .github/workflows/linux-ci.yml | 29 ------------ .github/workflows/msvc-ci.yml | 29 ------------ 4 files changed, 55 insertions(+), 125 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/codeql-analysis.yml delete mode 100644 .github/workflows/linux-ci.yml delete mode 100644 .github/workflows/msvc-ci.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..b8ab744 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,55 @@ +name: Build +on: + push: + branches: [ci-build] + pull_request: + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + steps: + - uses: actions/checkout@v4 + + - name: Build + run: | + mkdir build + cd build + cmake .. + cmake --build . --config Debug + cmake --install . + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: pyarmor-1shot-build-${{ matrix.os }} + path: | + helpers + README.md + README-Decompyle++.markdown + LICENSE + + windows-build: + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + + - name: Build + run: | + mkdir build + cd build + cmake -G "MinGW Makefiles" .. + cmake --build . --config Debug + cmake --install . + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: pyarmor-1shot-build-windows + path: | + helpers + README.md + README-Decompyle++.markdown + LICENSE diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index 0db91ee..0000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,67 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -name: "CodeQL" - -on: - push: - branches: [master] - pull_request: - # The branches below must be a subset of the branches above - branches: [master] - schedule: - - cron: '0 1 * * 2' - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: ['cpp', 'python'] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] - # Use only 'java' to analyze code written in Java, Kotlin or both - # Use only 'javascript' to analyze code written in JavaScript, TypeScript or both - # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - - # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs - # queries: security-extended,security-and-quality - - # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - if: matrix.language == 'python' - name: Autobuild Python - uses: github/codeql-action/autobuild@v2 - - - if: matrix.language == 'cpp' - name: Build C++ - run: | - mkdir build && cd build - cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo .. - make - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 - with: - category: "/language:${{matrix.language}}" diff --git a/.github/workflows/linux-ci.yml b/.github/workflows/linux-ci.yml deleted file mode 100644 index ddc8532..0000000 --- a/.github/workflows/linux-ci.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Linux-CI -on: - push: - branches: [master] - pull_request: - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - name: Configure and Build - run: | - ( - mkdir build-debug && cd build-debug - cmake -DCMAKE_BUILD_TYPE=Debug .. - make -j4 - ) - - ( - mkdir build-release && cd build-release - cmake -DCMAKE_BUILD_TYPE=Debug .. - make -j4 - ) - - - name: Test - run: | - cmake --build build-debug --target check - cmake --build build-release --target check diff --git a/.github/workflows/msvc-ci.yml b/.github/workflows/msvc-ci.yml deleted file mode 100644 index 1f2c48d..0000000 --- a/.github/workflows/msvc-ci.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: MSVC-CI -on: - push: - branches: [master] - pull_request: - -jobs: - build: - runs-on: windows-latest - steps: - - uses: actions/checkout@v2 - - name: Configure and Build - run: | - mkdir build - cd build - cmake -G "Visual Studio 17 2022" -A Win32 .. - cmake --build . --config Debug - cmake --build . --config Release - - - name: Test - run: | - cmake --build build --config Debug --target check - cmake --build build --config Release --target check - - - name: Upload artifact - uses: actions/upload-artifact@v3 - with: - name: pycdc-release - path: build\Release\*.exe