Skip to content

added deployment directory path #4159

added deployment directory path

added deployment directory path #4159

Workflow file for this run

name: build
on:
push:
branches-ignore: [ 'main' ]
jobs:
Lint:
name: 🧽 Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
id: cache-dependencies
with:
python-version: '3.9'
cache: 'pipenv'
cache-dependency-path: |
Pipfile.lock
- name: Install pipenv
run: pip install pipenv
- name: Install dependencies
if: steps.cache-dependencies.outputs.cache-hit != 'true'
run: pipenv install -d --deploy
- name: Check formatting
run: pipenv run format
- name: Run lint
run: pipenv run lint
- name: Run test code lint
run: pipenv run lint-test
TypeCheck:
name: 🧐 Check types
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
id: cache-dependencies
with:
python-version: '3.9'
cache: 'pipenv'
cache-dependency-path: |
Pipfile.lock
- name: Install pipenv
run: pip install pipenv
- name: Install dependencies
if: steps.cache-dependencies.outputs.cache-hit != 'true'
run: pipenv install -d --deploy
- name: Check types
run: pipenv run check-types
- name: Check types test
run: pipenv run check-types-test
Test:
name: 🧪 Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
id: cache-dependencies
with:
python-version: '3.9'
cache: 'pipenv'
cache-dependency-path: |
Pipfile.lock
- name: Install pipenv
run: pip install pipenv
- name: Install dependencies
if: steps.cache-dependencies.outputs.cache-hit != 'true'
run: pipenv install -d --deploy
- name: Test
run: pipenv run test-ci
- name: Validate Config Example
run: pipenv run validate-config-example
- name: Coverage to xml
run: pipenv run test-ci-coverage
- name: Code Coverage Report
uses: irongut/CodeCoverageSummary@v1.3.0
with:
filename: build/coverage.xml
badge: true
fail_below_min: true
format: markdown
hide_branch_rate: false
hide_complexity: true
indicators: true
output: both
thresholds: '79 99'
- name: Find PR number
uses: jwalton/gh-find-current-pr@v1
id: findPr
if: github.ref_name != 'main'
with:
state: open
- name: Add Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@v2
with:
number: ${{ steps.findPr.outputs.pr }}
path: code-coverage-results.md
Build_And_Upload:
name: 🏗️ Build package
runs-on: ubuntu-latest
outputs:
mpylVersion: ${{ steps.version.outputs.mpylVersion }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
id: cache-dependencies
with:
python-version: '3.9'
cache: 'pipenv'
cache-dependency-path: |
Pipfile.lock
- name: Install pipenv
run: pip install pipenv
- name: Install dependencies
if: steps.cache-dependencies.outputs.cache-hit != 'true'
run: pipenv install -d --deploy
- name: Find PR number
uses: jwalton/gh-find-current-pr@v1
id: findPr
if: github.ref_name != 'main'
with:
state: open
- name: Publish PR Number
id: pr
run: |
echo "pr=${{ steps.findPr.outputs.pr }}" >> "$GITHUB_OUTPUT"
- name: Create Version
id: version
run: |
echo "mpylVersion=${{ steps.findPr.outputs.pr }}.${{ github.run_number }}" >> "$GITHUB_OUTPUT"
- name: Build
if: github.ref_name != 'main'
env:
PIPENV_DONT_LOAD_ENV: true
MPYL_VERSION: ${{ steps.version.outputs.mpylVersion }}
run: pipenv run build
- name: Publish package
id: publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
TWINE_REPOSITORY_URL: https://test.pypi.org/legacy/
run: pipenv run publish
- name: Ensure package is in pypi cache
run: pipenv run release exists ${{ steps.version.outputs.mpylVersion }} --test --attempts 5
Integration_Test_PR:
name: Test PR
runs-on: ubuntu-latest
needs: [ Build_And_Upload ]
env:
MPYL_CONFIG_PATH: mpyl_config.example.yml
steps:
- uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Prefetch MPyL
continue-on-error: true
run: pip install --dry-run -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple mpyl==${{ needs.Build_And_Upload.outputs.mpylVersion }} || true
- name: Install MPyL
run: pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple mpyl==${{ needs.Build_And_Upload.outputs.mpylVersion }}
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/setup-kind
with:
traefik-chart-version: 27.0.2
prometheus-chart-version: 60.3.0
sealed-secrets-chart-version: 2.7.3
spark-operator-chart-version: 1.1.25
- name: Check mpyl health
run: mpyl health --ci
- name: Lint projects
run: mpyl projects lint
- name: Validate upgrade status
run: mpyl projects upgrade
- name: Build status
run: mpyl build status --all
- name: Build run
run: mpyl build run --all
env:
SOME_CREDENTIAL: credential
Integration_Test_Tag:
name: Test tag
runs-on: ubuntu-latest
needs: [ Build_And_Upload ]
env:
MPYL_CONFIG_PATH: mpyl_config.example.yml
steps:
- uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Prefetch MPyL Attempt
continue-on-error: true
run: pip install --dry-run -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple mpyl==${{ needs.Build_And_Upload.outputs.mpylVersion }} || true
- name: Install MPyL
run: pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple mpyl==${{ needs.Build_And_Upload.outputs.mpylVersion }}
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/setup-kind
with:
traefik-chart-version: 27.0.2
prometheus-chart-version: 60.3.0
sealed-secrets-chart-version: 2.7.3
spark-operator-chart-version: 1.1.25
- name: Get head revision
id: headRevision
run: echo "headRevision=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
- name: Build status
run: mpyl build status
- name: Force change
run: |
echo "To force a change " >> tests/projects/service/change.txt
git add tests/projects/service/change.txt
- name: Commit the change
run: |
git config --global user.email "somebody@somewhere.com"
git config --global user.name "Some Person"
git commit -a -m "A random change"
- name: Switch to main
run: git checkout -b main ${{ steps.headRevision.outputs.headRevision }}
- name: Merge branch
run: git merge --no-ff -m "Merge PR ${{ github.ref }}" ${{ github.ref }}
- name: Tag merge
run: git tag -a v${{ needs.Build_And_Upload.outputs.mpylVersion }} -m "Tagging v${{ needs.Build_And_Upload.outputs.mpylVersion }}"
- name: Show build status
env:
TAG_NAME: v${{ needs.Build_And_Upload.outputs.mpylVersion }}
run: mpyl build status
- name: Run tag build
env:
TAG_NAME: v${{ needs.Build_And_Upload.outputs.mpylVersion }}
SOME_CREDENTIAL: credential
run: mpyl build run
Build_Package:
# TODO: Rename this step and update the merge rule to match
# name: Publish v${{ needs.Build_And_Upload.outputs.mpylVersion }}
runs-on: ubuntu-latest
needs: [ Build_And_Upload, Lint, TypeCheck, Test, Integration_Test_PR, Integration_Test_Tag ]
env:
MPYL_CONFIG_PATH: mpyl_config.example.yml
steps:
- name: Comment Published package
uses: thollander/actions-comment-pull-request@v2
if: success()
with:
pr_number: ${{ needs.Build_And_Upload.outputs.mpylVersion }}
message: |
New release `${{ needs.Build_And_Upload.outputs.mpylVersion }}` deployed at [Test Pypi](https://test.pypi.org/project/mpyl/).
Install with
```
pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple mpyl==${{ needs.Build_And_Upload.outputs.mpylVersion }}
```
reactions: rocket
comment_tag: execution
- name: Report deployed pacakge
run: echo '### New release! 🚀`${{ needs.Build_And_Upload.outputs.mpylVersion }}` deployed at [Test Pypi](https://test.pypi.org/project/mpyl/)' >> $GITHUB_STEP_SUMMARY