generated from ansys/template
-
Notifications
You must be signed in to change notification settings - Fork 4
Migrate github workflow to pyansys/actions. #81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
25b09a2
initial commit for the actions change
Revathyvenugopal162 55f1bb2
Add order for workflow
Revathyvenugopal162 a76f3fe
rename the worflow name
Revathyvenugopal162 1bf06f5
Update .github/workflows/ci_cd.yml
Revathyvenugopal162 919eb55
SKip the release by commenting
Revathyvenugopal162 d48f00d
SKip the release by commenting
Revathyvenugopal162 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,15 +19,12 @@ concurrency: | |
|
||
jobs: | ||
|
||
|
||
style: | ||
name: Code style | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
- name: PyAnsys code style checks | ||
uses: pyansys/actions/code-style@v1 | ||
with: | ||
python-version: ${{ env.MAIN_PYTHON_VERSION }} | ||
|
||
|
@@ -41,24 +38,26 @@ jobs: | |
name: Documentation Style Check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: PyAnsys documentation style checks | ||
uses: pyansys/actions/doc-style@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Running Vale | ||
uses: errata-ai/vale-action@reviewdog | ||
env: | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
docs-build: | ||
|
||
name: Doc building | ||
runs-on: ubuntu-latest | ||
needs: docs-style | ||
steps: | ||
- name: "Run Ansys documentation building action" | ||
uses: pyansys/actions/doc-build@v1 | ||
with: | ||
files: doc | ||
reporter: github-pr-check | ||
level: error | ||
filter_mode: nofilter | ||
fail_on_error: true | ||
vale_flags: "--config=doc/.vale.ini" | ||
python-version: ${{ env.MAIN_PYTHON_VERSION }} | ||
|
||
tests: | ||
name: Build and testing | ||
runs-on: ubuntu-latest | ||
needs: [style,docs] | ||
needs: [style,docs-build] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
@@ -105,99 +104,28 @@ jobs: | |
path: dist/ | ||
retention-days: 7 | ||
|
||
docs: | ||
name: Documentation | ||
runs-on: ubuntu-latest | ||
needs: [docs-style] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ env.MAIN_PYTHON_VERSION }} | ||
|
||
- name: Install OS packages | ||
run: | | ||
sudo apt update | ||
sudo apt install zip pandoc libgl1-mesa-glx xvfb texlive-latex-extra latexmk | ||
|
||
- name: Install library | ||
run: pip install . | ||
|
||
- name: Build HTML | ||
run: | | ||
pip install .[doc] | ||
make -C doc html SPHINXOPTS="-W" | ||
|
||
- name: Generate the PDF documentation | ||
run: | | ||
make -C doc pdf | ||
|
||
- name: Upload HTML documentation | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: HTML-Documentation | ||
path: doc/build/html | ||
retention-days: 7 | ||
|
||
- name: Upload PDF Documentation | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: Documentation-pdf | ||
path: doc/build/latex/*.pdf | ||
retention-days: 7 | ||
release: | ||
|
||
Release: | ||
if: contains(github.ref, 'refs/tags') | ||
needs: [tests, style, docs] | ||
name: "Release project to private PyPI, public PyPI and GitHub" | ||
if: github.event_name == 'push' && contains(github.ref, 'refs/tags') | ||
needs: [tests] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.9 | ||
|
||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: ansys-pyoptics-wheel | ||
|
||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: Documentation-pdf | ||
|
||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: Documentation-html | ||
path: ~/html | ||
|
||
# list current directory | ||
- name: List directory structure | ||
run: ls -R | ||
|
||
- name: Deploy | ||
uses: JamesIves/[email protected] | ||
with: | ||
BRANCH: gh-pages | ||
FOLDER: ~/html | ||
CLEAN: true | ||
|
||
# note how we use the PyPI tokens | ||
- name: Upload to Azure PyPi (disabled) | ||
run: | | ||
pip install twine | ||
# twine upload --skip-existing ./**/*.whl | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | ||
|
||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: | | ||
./**/*.whl | ||
./**/*.zip | ||
# - name: "Release to the private PyPI repository" | ||
# uses: pyansys/actions/release-pypi-private@v1 | ||
# with: | ||
# library-name: ${{ env.PACKAGE_NAME }} | ||
# twine-username: "__token__" | ||
# twine-token: ${{ secrets.PYANSYS_PYPI_PRIVATE_PAT }} | ||
# | ||
# - name: "Release to the public PyPI repository" | ||
# uses: pyansys/actions/release-pypi-public@v1 | ||
# with: | ||
# library-name: ${{ env.PACKAGE_NAME }} | ||
# twine-username: "__token__" | ||
# twine-token: ${{ secrets.PYPI_TOKEN }} | ||
# | ||
- name: "Release to GitHub" | ||
uses: pyansys/actions/release-github@v1 | ||
with: | ||
library-name: ${{ env.PACKAGE_NAME }} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.