diff --git a/.github/workflows/build-publish-documentation.yaml b/.github/workflows/build-publish-documentation.yaml new file mode 100644 index 00000000..eb156190 --- /dev/null +++ b/.github/workflows/build-publish-documentation.yaml @@ -0,0 +1,64 @@ +name: Build and deploy documentation + +# Controls when the action will run. Triggers the workflow on PR to main +on: + push: + branches: + - main + paths: + - "mkdocs.yml" + - "linkml_model/model/schema/*.yaml" + - "linkml_model/model/docs/*" + +jobs: + github-pages: + runs-on: ubuntu-latest + + steps: + #---------------------------------------------- + # check-out repo and set-up python + #---------------------------------------------- + - name: Check out repository + uses: actions/checkout@v2 + + - name: Setup Python 3.9 + uses: actions/setup-python@v2 + with: + python-version: 3.9 + + #---------------------------------------------- + # install & configure poetry + #---------------------------------------------- + - name: Install Poetry + uses: snok/install-poetry@v1.3 + with: + virtualenvs-create: true + virtualenvs-in-project: true + + #---------------------------------------------- + # load cached venv if cache exists + #---------------------------------------------- + - name: Load cached venv + id: cached-poetry-dependencies + uses: actions/cache@v2 + with: + path: .venv + key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} + + #---------------------------------------------- + # install dependencies if cache does not exist + #---------------------------------------------- + - name: Install dependencies + if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' + run: poetry install --no-interaction --no-root + + #---------------------------------------------- + # generate markdown files + #---------------------------------------------- + - run: make gendoc + + #---------------------------------------------- + # deploy documentation + #---------------------------------------------- + - run: make deploy + \ No newline at end of file diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 7df0342a..f3b8496f 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -2,7 +2,7 @@ # https://docs.github.com/en/actions/guides/building-and-testing-python # https://github.com/snok/install-poetry#workflows-and-tips -name: Build and test linkml-runtime +name: Build and test linkml-model on: [pull_request] diff --git a/.github/workflows/pr-test.yaml b/.github/workflows/pr-test.yaml deleted file mode 100644 index 8baacf1b..00000000 --- a/.github/workflows/pr-test.yaml +++ /dev/null @@ -1,32 +0,0 @@ -name: Pull request unit tests - -on: - pull_request: - branches: [ main ] - -jobs: - - build-pipenv: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.8 - - - name: Install pipenv - uses: dschep/install-pipenv-action@v1 - - - name: Run make file - run: | - pipenv install --dev - make - - - name: Run unit tests over results - run: | - pipenv install --dev - pipenv run python -m unittest discover -p 'test_*.py' diff --git a/.github/workflows/pypi-publish.yaml b/.github/workflows/pypi-publish.yaml index b9eb0693..2babdf64 100644 --- a/.github/workflows/pypi-publish.yaml +++ b/.github/workflows/pypi-publish.yaml @@ -15,7 +15,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2.2.2 with: - python-version: 3.8 + python-version: 3.9 - name: Install Poetry uses: snok/install-poetry@v1.1.6