Skip to content
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

update GH actions to use poetry 1.x #283

Merged
merged 16 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 9 additions & 22 deletions .github/workflows/build-deploy-documentation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,35 +18,22 @@ jobs:
#----------------------------------------------
# check-out repo and set-up python
#----------------------------------------------

- name: Install Poetry
run: pipx install poetry==1.4.0

- name: Check out repository
uses: actions/checkout@v4
uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: ${{ matrix.python-version }}
cache: 'poetry'

#----------------------------------------------
# install & configure poetry
#----------------------------------------------
- name: Install Poetry
uses: snok/[email protected]
with:
virtualenvs-create: true
virtualenvs-in-project: true

#----------------------------------------------
# install dependencies if cache does not exist
#----------------------------------------------
- name: Install dependencies
- name: Install Dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root

#----------------------------------------------
# install your root project, if required
#----------------------------------------------
- name: Install library
run: poetry install --no-interaction

- name: Generate and deploy documentation
run: make gh-deploy-docs
37 changes: 10 additions & 27 deletions .github/workflows/check-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,47 +3,30 @@ name: Test PRs
on: [pull_request]

jobs:
test:
build:
runs-on: ubuntu-latest

strategy:
matrix:
python-version: [3.9]
python-version: ["3.9", "3.10", "3.11"]

steps:

#----------------------------------------------
# check-out repo and set-up python
#----------------------------------------------
- name: Install Poetry
run: pipx install poetry==1.4.0

- name: Check out repository
uses: actions/checkout@v4
uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'

#----------------------------------------------
# install & configure poetry
#----------------------------------------------
- name: Install Poetry
uses: snok/[email protected]
with:
virtualenvs-create: true
virtualenvs-in-project: true

#----------------------------------------------
# install dependencies if cache does not exist
#----------------------------------------------
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
- name: Install Dependencies
run: poetry install --no-interaction --no-root

#----------------------------------------------
# install your root project, if required
#----------------------------------------------
- name: Install library
run: poetry install --no-interaction

- name: regenerate artifacts and validate against generated artifacts
run: |
make clean
Expand Down
107 changes: 49 additions & 58 deletions .github/workflows/regenerate_artifacts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,69 +12,60 @@ jobs:
permissions:
contents: write

steps:
- name: Checkout
uses: actions/checkout@v4
strategy:
matrix:
python-version: ["3.9"]

- name: Setup Python Environment
uses: actions/setup-python@v5
with:
python-version: 3.9
steps:
- name: Install Poetry
run: pipx install poetry==1.4.0

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '8'
- name: Check out repository
uses: actions/checkout@v3

- name: Setup build environment
run: |
sudo apt update
sudo apt install -y graphviz
wget https://github.com/joelittlejohn/jsonschema2pojo/releases/download/jsonschema2pojo-1.0.2/jsonschema2pojo-1.0.2.tar.gz
tar -xvzf jsonschema2pojo-1.0.2.tar.gz
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'

#----------------------------------------------
# install & configure poetry
#----------------------------------------------
- name: Install Poetry
uses: snok/[email protected]
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Install Dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root

#----------------------------------------------
# install dependencies if cache does not exist
#----------------------------------------------
- name: Install poetry dependencies
run: poetry install --no-interaction --no-root
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '8'

#----------------------------------------------
# install your root project, if required
#----------------------------------------------
- name: Install library
run: poetry install --no-interaction
- name: Setup build environment
run: |
sudo apt update
sudo apt install -y graphviz
wget https://github.com/joelittlejohn/jsonschema2pojo/releases/download/jsonschema2pojo-1.0.2/jsonschema2pojo-1.0.2.tar.gz
tar -xvzf jsonschema2pojo-1.0.2.tar.gz

- name: Generate AGR Curation Model artifacts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr checkout ${{ github.event.pull_request.number }}
export PATH=$PATH:`pwd`/jsonschema2pojo-1.0.2/bin
make clean-artifacts
make -B gen-artifacts
- name: Generate AGR Curation Model artifacts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr checkout ${{ github.event.pull_request.number }}
export PATH=$PATH:`pwd`/jsonschema2pojo-1.0.2/bin
make clean-artifacts
make -B gen-artifacts

- name: Commit and push artifacts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: |
if [[ $(git add -n generated/) ]]; then
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add generated/
git commit -m "Automated artifacts regeneration [skip actions]"
git push
else
echo "No artifact changes to commit."
fi
- name: Commit and push artifacts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: |
if [[ $(git add -n generated/) ]]; then
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add generated/
git commit -m "Automated artifacts regeneration [skip actions]"
git push
else
echo "No artifact changes to commit."
fi
Loading
Loading