From cfb9e350959ed52a8925c4012b7626ab21634e22 Mon Sep 17 00:00:00 2001 From: Simon Diesenreiter Date: Sat, 9 Nov 2024 09:12:20 -0800 Subject: [PATCH] fix action issues --- .gitea/workflows/main.yml | 72 ++++++++++++++--------------- .gitea/workflows/rename_project.yml | 41 ++++++++-------- 2 files changed, 55 insertions(+), 58 deletions(-) diff --git a/.gitea/workflows/main.yml b/.gitea/workflows/main.yml index c9d5946..37da8b2 100644 --- a/.gitea/workflows/main.yml +++ b/.gitea/workflows/main.yml @@ -49,40 +49,40 @@ jobs: - name: Run tests run: make test - tests_mac: - needs: linter - strategy: - fail-fast: false - matrix: - python-version: [3.9] - os: [macos-latest] - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Install project - run: make install - - name: Run tests - run: make test + # tests_mac: + # needs: linter + # strategy: + # fail-fast: false + # matrix: + # python-version: [3.9] + # os: [macos-latest] + # runs-on: ${{ matrix.os }} + # steps: + # - uses: actions/checkout@v3 + # - uses: actions/setup-python@v4 + # with: + # python-version: ${{ matrix.python-version }} + # - name: Install project + # run: make install + # - name: Run tests + # run: make test - tests_win: - needs: linter - strategy: - fail-fast: false - matrix: - python-version: [3.9] - os: [windows-latest] - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Install Pip - run: pip install --user --upgrade pip - - name: Install project - run: pip install -e .[test] - - name: run tests - run: pytest -s -vvvv -l --tb=long tests + # tests_win: + # needs: linter + # strategy: + # fail-fast: false + # matrix: + # python-version: [3.9] + # os: [windows-latest] + # runs-on: ${{ matrix.os }} + # steps: + # - uses: actions/checkout@v3 + # - uses: actions/setup-python@v4 + # with: + # python-version: ${{ matrix.python-version }} + # - name: Install Pip + # run: pip install --user --upgrade pip + # - name: Install project + # run: pip install -e .[test] + # - name: run tests + # run: pytest -s -vvvv -l --tb=long tests diff --git a/.gitea/workflows/rename_project.yml b/.gitea/workflows/rename_project.yml index 80b8831..577b009 100644 --- a/.gitea/workflows/rename_project.yml +++ b/.gitea/workflows/rename_project.yml @@ -6,7 +6,7 @@ permissions: write-all jobs: rename-project: - if: ${{ !contains (gitea.repository, '/Pythonx') }} + if: ${{ !equals (GITHUB_REPOSITORY, 'Templates/Python') }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -16,30 +16,27 @@ jobs: fetch-depth: 0 ref: ${{ gitea.head_ref }} - - run: env + - run: echo "REPOSITORY_NAME=$(echo '${{ GITHUB_REPOSITORY }}' | awk -F '/' '{print $2}' | tr '-' '_' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV shell: bash - - # - run: echo "REPOSITORY_NAME=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}' | tr '-' '_' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV - # shell: bash - # - run: echo "REPOSITORY_URLNAME=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV - # shell: bash + - run: echo "REPOSITORY_URLNAME=$(echo '${{ GITHUB_REPOSITORY }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV + shell: bash - # - run: echo "REPOSITORY_OWNER=$(echo '${{ github.repository }}' | awk -F '/' '{print $1}')" >> $GITHUB_ENV - # shell: bash + - run: echo "REPOSITORY_OWNER=$(echo '${{ GITHUB_REPOSITORY }}' | awk -F '/' '{print $1}')" >> $GITHUB_ENV + shell: bash - # - name: Is this still a template - # id: is_template - # run: echo "::set-output name=is_template::$(ls .gitea/template.yml &> /dev/null && echo true || echo false)" + - name: Is this still a template + id: is_template + run: echo "::set-output name=is_template::$(ls .gitea/template.yml &> /dev/null && echo true || echo false)" - # - name: Rename the project - # if: steps.is_template.outputs.is_template == 'true' - # run: | - # echo "Renaming the project with -a(author) ${{ env.REPOSITORY_OWNER }} -n(name) ${{ env.REPOSITORY_NAME }} -u(urlname) ${{ env.REPOSITORY_URLNAME }}" - # .gitea/rename_project.sh -a ${{ env.REPOSITORY_OWNER }} -n ${{ env.REPOSITORY_NAME }} -u ${{ env.REPOSITORY_URLNAME }} -d "Awesome ${{ env.REPOSITORY_NAME }} created by ${{ env.REPOSITORY_OWNER }}" + - name: Rename the project + if: steps.is_template.outputs.is_template == 'true' + run: | + echo "Renaming the project with -a(author) ${{ env.REPOSITORY_OWNER }} -n(name) ${{ env.REPOSITORY_NAME }} -u(urlname) ${{ env.REPOSITORY_URLNAME }}" + .gitea/rename_project.sh -a ${{ env.REPOSITORY_OWNER }} -n ${{ env.REPOSITORY_NAME }} -u ${{ env.REPOSITORY_URLNAME }} -d "Awesome ${{ env.REPOSITORY_NAME }} created by ${{ env.REPOSITORY_OWNER }}" - # - uses: stefanzweifel/git-auto-commit-action@v4 - # with: - # commit_message: "✅ Ready to clone and code." - # # commit_options: '--amend --no-edit' - # push_options: --force + - uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: "✅ Ready to clone and code." + # commit_options: '--amend --no-edit' + push_options: --force