make autotest really work #44
Workflow file for this run
This file contains 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
name: Continuous Integration And Automated Testing | |
on: | |
push: | |
pull_request: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install --upgrade setuptools | |
pip install build | |
- name: Build package | |
run: python -m build | |
- name: upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
path: dist | |
- name: cleanup artifacts | |
run: rm -r dist | |
test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [macos-latest, ubuntu-latest] | |
needs: build | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v3 | |
- name: Set up python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: '3.x' | |
- name: Install MacPorts(Mac) | |
if: matrix.os == 'macos-latest' | |
uses: melusina-org/gha-install-macports@v1.0.0 | |
- name: Install tesseract(Mac) | |
if: matrix.os == 'macos-latest' | |
run: | | |
sudo port install tesseract | |
- name: Install tesseract(Linux) | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
sudo apt install tesseract-ocr -y | |
- name: Install tesseract(Windows) | |
if: matrix.os == 'windows-latest' | |
run: | | |
echo 'Not available' | |
- name: Install artifact(Unix-like) | |
if: matrix.os != 'windows-latest' | |
run: | | |
python -m pip install --upgrade pip | |
cd artifact | |
pip install hust_login-*.whl | |
- name: Install artifact(WinNT-like) | |
if: matrix.os == 'windows-latest' | |
run: | | |
python -m pip install --upgrade pip | |
cd artifact | |
pip install --find-links=. hust_login | |
- name: Test module | |
run: | | |
python -m hust_login --autotest -U ${{ secrets.UID }} -P ${{ secrets.PWD }} | |
release: | |
runs-on: ubuntu-latest | |
needs: test | |
if: startsWith(github.ref, 'refs/tags/') | |
permissions: | |
contents: write | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v3 | |
- name: Create Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
artifact/* | |
- name: Publish package | |
if: (! endsWith(github.ref, 'dev')) | |
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
packages_dir: artifact | |
repository_url: https://upload.pypi.org/legacy/ | |