-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
run-tests.sh and basic GH actions added
- Loading branch information
1 parent
8766793
commit 8d4e21c
Showing
3 changed files
with
118 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: Build | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
oarepo: | ||
description: OARepo version (11, 12, ...) | ||
required: true | ||
default: 12 | ||
type: string | ||
|
||
env: | ||
OAREPO_VERSION: ${{ inputs.oarepo }} | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
steps: | ||
|
||
- name: Show oarepo version | ||
run: | | ||
echo "OAREPO_VERSION: >>>$OAREPO_VERSION<<<" | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.12" | ||
- name: Cache pip | ||
uses: actions/cache@v4 | ||
with: | ||
# This path is specific to Ubuntu | ||
path: ~/.cache/pip | ||
# Look to see if there is a cache hit for the corresponding requirements file | ||
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
${{ runner.os }}- | ||
- name: Configure sysctl limits | ||
run: | | ||
sudo swapoff -a | ||
sudo sysctl -w vm.swappiness=1 | ||
sudo sysctl -w fs.file-max=262144 | ||
sudo sysctl -w vm.max_map_count=262144 | ||
#- name: Runs Opensearch | ||
# uses: ankane/setup-opensearch@v1 | ||
# with: | ||
# opensearch-version: 2 | ||
# plugins: analysis-icu | ||
|
||
#- name: Start Redis | ||
# uses: supercharge/[email protected] | ||
# with: | ||
# redis-version: ${{ matrix.redis-version }} | ||
|
||
|
||
- name: Run tests | ||
run: | | ||
./run-tests.sh | ||
- name: Freeze packages | ||
run: | | ||
pip freeze > requirements.txt | ||
- name: Build package to publish | ||
run: | | ||
pip install -U setuptools pip wheel | ||
python setup.py sdist bdist_wheel | ||
- name: Archive production artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: dist | ||
path: dist | ||
|
||
- name: Archive production artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: requirements.txt | ||
path: requirements.txt |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: Manual test | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
oarepo: | ||
description: OARepo version (11, 12, ...) | ||
required: true | ||
default: 12 | ||
jobs: | ||
build: | ||
uses: ./.github/workflows/build.yaml | ||
with: | ||
oarepo: ${{ github.event.inputs.oarepo }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
OAREPO_VERSION="${OAREPO_VERSION:-12}" | ||
|
||
VENV=".venv" | ||
|
||
if test -d $VENV ; then | ||
rm -rf $VENV | ||
fi | ||
|
||
python3 -m venv $VENV | ||
. $VENV/bin/activate | ||
pip install -U setuptools pip wheel pytest | ||
|
||
#echo "Installing oarepo version $OAREPO_VERSION" | ||
#pip install "oarepo==${OAREPO_VERSION}.*" | ||
pip install -e ".[tests]" | ||
|
||
pytest -v -x tests |