From 521e4580c5bc9a9d68a3b6a708b88990dcbc4024 Mon Sep 17 00:00:00 2001 From: z1turn0 Date: Wed, 31 Jan 2024 22:06:25 +0800 Subject: [PATCH] fix: add pip dependencies requirements.txt --- .../workflows/check-all-loser-homework.yml | 41 ++++++++++--------- .../check-changed-loser-homework.yml | 27 ++++++------ requirements.txt | 1 + 3 files changed, 38 insertions(+), 31 deletions(-) create mode 100644 requirements.txt diff --git a/.github/workflows/check-all-loser-homework.yml b/.github/workflows/check-all-loser-homework.yml index b00cad36..8e28650f 100644 --- a/.github/workflows/check-all-loser-homework.yml +++ b/.github/workflows/check-all-loser-homework.yml @@ -30,20 +30,21 @@ jobs: cxx_compiler: g++-13 steps: - - uses: actions/checkout@v4 - - - name: Install python-slugigy - run: | - pip install python-slugify[unidecode] + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + cache: 'pip' + - run: pip install -r requirements.txt - - name: Configure CMake - run: cmake -B ${{github.workspace}}/build -DCMAKE_CXX_COMPILER=$cxx_compiler + - name: Configure CMake + run: cmake -B ${{github.workspace}}/build -DCMAKE_CXX_COMPILER=$cxx_compiler - - name: Build - run: cmake --build ${{github.workspace}}/build --target build_loser_homework + - name: Build + run: cmake --build ${{github.workspace}}/build --target build_loser_homework - - name: Check run - run: cmake --build ${{github.workspace}}/build --target run_loser_homework + - name: Check run + run: cmake --build ${{github.workspace}}/build --target run_loser_homework check-in-clang: runs-on: ubuntu-latest @@ -52,16 +53,17 @@ jobs: steps: - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + cache: 'pip' + - run: pip install -r requirements.txt - name: Install clang 17 run: | wget https://apt.llvm.org/llvm.sh chmod u+x llvm.sh echo | sudo ./llvm.sh 17 - - - name: Install python-slugigy - run: | - pip install python-slugify[unidecode] - name: Configure CMake run: cmake -B ${{github.workspace}}/build -DCMAKE_CXX_COMPILER=$cxx_compiler @@ -77,10 +79,11 @@ jobs: steps: - uses: actions/checkout@v4 - - - name: Install python-slugigy - run: | - pip install python-slugify[unidecode] + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + cache: 'pip' + - run: pip install -r requirements.txt - name: Configure CMake run: cmake -B ${{github.workspace}}/build diff --git a/.github/workflows/check-changed-loser-homework.yml b/.github/workflows/check-changed-loser-homework.yml index 00786f56..ed3bbc70 100644 --- a/.github/workflows/check-changed-loser-homework.yml +++ b/.github/workflows/check-changed-loser-homework.yml @@ -57,6 +57,11 @@ jobs: steps: - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + cache: 'pip' + - run: pip install -r requirements.txt - name: Only keep cpp changed files if: needs.get-changed-files.outputs.any_changed == 'true' @@ -73,10 +78,6 @@ jobs: echo $find_command eval "$find_command" find ${{ env.src_path }} -type f \( -name "*.cpp" -o -name "*.cxx" -o -name "*.cc" \) - - - name: Install python-slugigy - run: | - pip install python-slugify[unidecode] - name: Configure CMake if: needs.get-changed-files.outputs.any_changed == 'true' @@ -98,6 +99,11 @@ jobs: steps: - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + cache: 'pip' + - run: pip install -r requirements.txt - name: Only keep cpp changed files if: needs.get-changed-files.outputs.any_changed == 'true' @@ -121,10 +127,6 @@ jobs: wget https://apt.llvm.org/llvm.sh chmod u+x llvm.sh echo | sudo ./llvm.sh 17 - - - name: Install python-slugigy - run: | - pip install python-slugify[unidecode] - name: Configure CMake if: needs.get-changed-files.outputs.any_changed == 'true' @@ -144,6 +146,11 @@ jobs: steps: - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + cache: 'pip' + - run: pip install -r requirements.txt - name: Only keep cpp changed files if: needs.get-changed-files.outputs.any_changed == 'true' @@ -167,10 +174,6 @@ jobs: } } - - name: Install python-slugigy - run: | - pip install python-slugify[unidecode] - - name: Configure CMake if: needs.get-changed-files.outputs.any_changed == 'true' run: cmake -B ${{github.workspace}}/build diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..fd0a357b --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +python-slugify>=7.0.0 \ No newline at end of file