diff --git a/.github/actions/renaming-script-composite-action/action.yml b/.github/actions/renaming-script-composite-action/action.yml new file mode 100644 index 0000000..f3c6bbc --- /dev/null +++ b/.github/actions/renaming-script-composite-action/action.yml @@ -0,0 +1,19 @@ +name: "Test renaming script" +runs: + using: "composite" + steps: + - name: "Setting permissions for script" + run: chmod +x set_app_name.sh + shell: bash + - name: "Testing renaming script with missing APP_NAME" + run: "! ./set_app_name.sh" + shell: bash + - name: "Testing renaming script with invalid name (unsupported characters)" + run: export APP_NAME="#INVALID" && ! ./set_app_name.sh + shell: bash + - name: "Testing renaming script with invalid name (exceeding length)" + run: export APP_NAME="this-app-has-a-name-that-exceeds-fifty-three-characters" && ! ./set_app_name.sh + shell: bash + - name: "Testing renaming script with valid name" + run: export APP_NAME="valid-app-name" && ./set_app_name.sh + shell: bash \ No newline at end of file diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 29fbd06..3e8af34 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -13,24 +13,30 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: Set up Python 3.10 - uses: actions/setup-python@v3 - with: - python-version: "3.10" - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install pylint pytest-cov requests_mock pytest - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - name: Pylint - run: | - pylint $(git ls-files '*.py') - - name: Pytest - run: | - python3 -m pytest --cov=eric-oss-hello-world-python-app --cov-fail-under=90 - - name: markdownlint-cli - uses: nosborn/github-action-markdown-cli@v3.3.0 - with: - files: . - config_file: .markdownlint.yaml + - uses: actions/checkout@v5 + - name: Set up Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: "3.10" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pylint pytest-cov requests_mock pytest + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Test renaming script + uses: ./.github/actions/renaming-script-composite-action + + - name: Pylint + run: | + pylint $(git ls-files '*.py') + - name: Pytest + run: | + python3 -m pytest --cov=eric-oss-hello-world-python-app --cov-fail-under=90 + - name: markdownlint-cli + uses: nosborn/github-action-markdown-cli@v3.3.0 + with: + files: . + config_file: .markdownlint.yaml + - name: Reset app name + run: export TARGET_DIR="../python-sample-app" && export APP_NAME="eric-oss-hello-world-python-app" && ./set_app_name.sh +