chore(gh): use setup-bentoml-action (#230)

This commit is contained in:
Aaron Pham
2023-08-17 08:34:35 -04:00
committed by GitHub
parent 8c7c1138b3
commit d7a6859c40
7 changed files with 27 additions and 65 deletions

View File

@@ -1,40 +0,0 @@
name: setup-repo
description: Setup repo with all features on CI
inputs:
python-version:
description: 'Python version'
required: true
default: '3.8'
architecture:
description: 'Which architecture to run on'
required: false
default: x64
runs:
using: composite
steps:
- name: Setup python
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # ratchet:actions/setup-python@v4
with:
python-version: ${{ inputs.python-version }}
architecture: ${{ inputs.architecture }}
- name: Get cache key prefix
id: get-cache-key-prefix
shell: bash
run: echo "prefix=${{ runner.os }}-${{ inputs.python-version }}" >> $GITHUB_OUTPUT
- name: Get pip cache dir
id: pip-cache-dir
shell: bash
run: echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
- name: Cache pip dependencies
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # ratchet:actions/cache@v3
id: cache-pip
with:
path: ${{ steps.pip-cache-dir.outputs.dir }}
key: ${{ steps.get-cache-key-prefix.outputs.prefix }}-pypi
restore-keys: |
${{ steps.get-cache-key-prefix.outputs.prefix }}-pypi-
- name: Install dependencies
shell: bash
run: pip install hatch towncrier
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@102b1a064a9b145e56556e22b18b19c624538d94 # ratchet:rlespinasse/github-slug-action@v4.4.1

View File

@@ -34,8 +34,9 @@ jobs:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # ratchet:actions/checkout@v3
with:
fetch-depth: 0
- name: Setup CI
uses: ./.github/actions/setup-repo
- uses: bentoml/setup-bentoml-action@59beefe94e2e8f8ebbedf555fc86bd5d1ae0a708 # ratchet:bentoml/setup-bentoml-action@v1
with:
bentoml-version: 'main'
- name: Pull latest change
if: ${{ github.event_name != 'pull_request' }}
run: git pull --autostash --no-edit --gpg-sign --ff origin main

View File

@@ -46,9 +46,9 @@ jobs:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # ratchet:actions/checkout@v3
with:
fetch-depth: 0
- name: Setup CI
uses: ./.github/actions/setup-repo
- uses: bentoml/setup-bentoml-action@59beefe94e2e8f8ebbedf555fc86bd5d1ae0a708 # ratchet:bentoml/setup-bentoml-action@v1
with:
bentoml-version: 'main'
python-version: ${{ matrix.python-version }}
- name: Run tests
run: hatch run tests:python
@@ -69,9 +69,9 @@ jobs:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # ratchet:actions/checkout@v3
with:
fetch-depth: 0
- name: Setup CI
uses: ./.github/actions/setup-repo
- uses: bentoml/setup-bentoml-action@59beefe94e2e8f8ebbedf555fc86bd5d1ae0a708 # ratchet:bentoml/setup-bentoml-action@v1
with:
bentoml-version: 'main'
python-version-file: .python-version-default
- name: Download coverage data
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # ratchet:actions/download-artifact@v3
@@ -111,9 +111,9 @@ jobs:
run: |
wget https://github.com/sharkdp/hyperfine/releases/download/v${HYPERFINE_VERSION}/hyperfine_${HYPERFINE_VERSION}_amd64.deb
sudo dpkg -i hyperfine_${HYPERFINE_VERSION}_amd64.deb
- name: Setup CI
uses: ./.github/actions/setup-repo
- uses: bentoml/setup-bentoml-action@59beefe94e2e8f8ebbedf555fc86bd5d1ae0a708 # ratchet:bentoml/setup-bentoml-action@v1
with:
bentoml-version: 'main'
python-version-file: .python-version-default
- name: Install self
run: pip install ./openllm-python

View File

@@ -41,8 +41,8 @@ env:
HATCH_VERBOSE: 2
CIBW_BUILD_FRONTEND: build
CIBW_ENVIRONMENT_PASS_LINUX: >
HATCH_BUILD_HOOKS_ENABLE
MYPYPATH
HATCH_BUILD_HOOKS_ENABLE MYPYPATH
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
@@ -55,8 +55,10 @@ jobs:
with:
fetch-depth: 0
ref: '${{ inputs.tags }}'
- name: Setup CI
uses: ./.github/actions/setup-repo
- uses: bentoml/setup-bentoml-action@59beefe94e2e8f8ebbedf555fc86bd5d1ae0a708 # ratchet:bentoml/setup-bentoml-action@v1
with:
bentoml-version: 'main'
python-version-file: .python-version-default
- name: Build
run: hatch build
working-directory: openllm-python
@@ -95,10 +97,10 @@ jobs:
with:
fetch-depth: 0
ref: '${{ inputs.tags }}'
- name: Setup CI
uses: ./.github/actions/setup-repo
- uses: bentoml/setup-bentoml-action@59beefe94e2e8f8ebbedf555fc86bd5d1ae0a708 # ratchet:bentoml/setup-bentoml-action@v1
with:
python-version: 3.8
bentoml-version: 'main'
python-version: '3.8'
- name: Build wheels via cibuildwheel
uses: pypa/cibuildwheel@39a63b5912f086dd459cf6fcb13dcdd3fe3bc24d # ratchet:pypa/cibuildwheel@v2.15.0
with:

View File

@@ -34,10 +34,10 @@ jobs:
with:
fetch-depth: 0
token: ${{ secrets.OPENLLM_PAT }}
- name: Setup CI
uses: ./.github/actions/setup-repo
- uses: bentoml/setup-bentoml-action@59beefe94e2e8f8ebbedf555fc86bd5d1ae0a708 # ratchet:bentoml/setup-bentoml-action@v1
with:
python-version: '3.11'
bentoml-version: 'main'
python-version-file: .python-version-default
- name: Import bot's GPG key for signing commits
id: import-gpg
uses: crazy-max/ghaction-import-gpg@72b6676b71ab476b77e676928516f6982eef7a41 # ratchet:crazy-max/ghaction-import-gpg@v5
@@ -202,10 +202,10 @@ jobs:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # ratchet:actions/checkout@v3
with:
fetch-depth: 0
- name: Setup CI
uses: ./.github/actions/setup-repo
- uses: bentoml/setup-bentoml-action@59beefe94e2e8f8ebbedf555fc86bd5d1ae0a708 # ratchet:bentoml/setup-bentoml-action@v1
with:
python-version: '3.11'
bentoml-version: 'main'
python-version-file: .python-version-default
- name: Install jq and curl
run: sudo apt-get install -y jq curl
- name: Import bot's GPG key for signing commits

View File

@@ -28,10 +28,10 @@ jobs:
with:
fetch-depth: 0
ref: '${{ inputs.tags }}'
- name: Setup CI
uses: ./.github/actions/setup-repo
- uses: bentoml/setup-bentoml-action@59beefe94e2e8f8ebbedf555fc86bd5d1ae0a708 # ratchet:bentoml/setup-bentoml-action@v1
with:
python-version: '3.11'
bentoml-version: 'main'
python-version-file: .python-version-default
- name: Create release notes
run: ./.github/actions/create_release_and_archive.sh ${{ inputs.tags }}
- name: Download Python artifacts

View File

@@ -12,4 +12,3 @@ cd "$GIT_ROOT" || exit 1
)
find "${GIT_ROOT}/.github/workflows" -type f -iname '*.yml' -exec docker run -it --rm -v "${PWD}":"${PWD}" -w "${PWD}" -e RATCHET_EXP_KEEP_NEWLINES=true ghcr.io/sethvargo/ratchet:0.4.0 pin {} \;
docker run -it --rm -v "${PWD}":"${PWD}" -w "${PWD}" -e RATCHET_EXP_KEEP_NEWLINES=true ghcr.io/sethvargo/ratchet:0.4.0 pin .github/actions/setup-repo/action.yml