refactor(client): refactor handler args with @starwhale.argument
decorator
#6661
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: End to End Test | |
on: | |
workflow_dispatch: | |
inputs: | |
debug_enabled: | |
type: boolean | |
description: "Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)" | |
required: false | |
default: false | |
pull_request: | |
branches: | |
- main | |
concurrency: | |
group: '${{ github.workflow }} @ ${{ github.ref }}' | |
cancel-in-progress: true | |
env: | |
PYPI_RELEASE_VERSION: 100.0.0 | |
RELEASE_VERSION: 0.0.0-dev | |
NEXUS_IMAGE: sonatype/nexus3:3.40.1 | |
NEXUS_USER_NAME: admin | |
NEXUS_USER_PWD: admin123 | |
PORT_NEXUS: 8081 | |
PORT_NEXUS_DOCKER: 8083 | |
IP_DOCKER_BRIDGE: 172.17.0.1 | |
REPO_NAME_DOCKER: docker-hosted | |
REPO_NAME_PYPI: pypi-hosted | |
jobs: | |
filter: | |
runs-on: ubuntu-latest | |
outputs: | |
client: ${{ steps.filter.outputs.client }} | |
server: ${{ steps.filter.outputs.server }} | |
scripts: ${{ steps.filter.outputs.scripts }} | |
docker: ${{ steps.filter.outputs.docker }} | |
example: ${{ steps.filter.outputs.example }} | |
labels: ${{ steps.pr-labels.outputs.labels }} | |
server_api: ${{ steps.filter.outputs.server_api }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Get PR labels | |
id: pr-labels | |
uses: joerick/[email protected] | |
- name: Check for files changed | |
uses: getsentry/paths-filter@v2 | |
id: filter | |
with: | |
base: main | |
filters: .github/file-filter.yml | |
e2e-test: | |
runs-on: ubuntu-latest | |
needs: | |
- filter | |
if: ${{ github.event_name == 'push' | |
|| github.event_name == 'workflow_dispatch' | |
|| (github.event_name == 'pull_request' | |
&& (needs.filter.outputs.client == 'true' | |
|| needs.filter.outputs.server == 'true' | |
|| needs.filter.outputs.scripts == 'true' | |
|| needs.filter.outputs.docker == 'true' | |
|| needs.filter.outputs.example == 'true' | |
) | |
&& contains(needs.filter.outputs.labels, 'e2e') | |
) | |
|| needs.filter.outputs.server_api == 'true' }} | |
defaults: | |
run: | |
shell: bash | |
strategy: | |
matrix: | |
python-version: | |
- "3.7" | |
- "3.8" | |
- "3.9" | |
- "3.10" | |
- "3.11" | |
server-driver: | |
- "docker-compose" | |
- "minikube" | |
exclude: | |
- python-version: "3.10" | |
server-driver: "docker-compose" | |
- python-version: "3.9" | |
server-driver: "docker-compose" | |
- python-version: "3.8" | |
server-driver: "minikube" | |
- python-version: "3.7" | |
server-driver: "minikube" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{matrix.python-version}} | |
architecture: "x64" | |
- name: Cache local Maven repository | |
uses: actions/cache@v3 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: "11" | |
distribution: "adopt" | |
cache: "maven" | |
server-id: starwhale # Value of the distributionManagement/repository/id field of the pom.xml | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16.x | |
# Github default free runner provides 14GB of disk space, we should release some useless files for workarounds. | |
- name: Release disk space | |
run: | | |
echo "cleanup useless files..." | |
df -hT | |
sudo rm -rf /usr/share/dotnet | |
sudo rm -rf /opt/ghc | |
sudo rm -rf "/usr/local/share/boost" | |
sudo rm -rf "$AGENT_TOOLSDIRECTORY"/{CodeQL,Ruby,go,node} | |
echo "cleanup done." | |
df -hT | |
- name: Setup tmate session | |
uses: mxschmitt/action-tmate@v3 | |
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }} | |
- name: Startup nexus service | |
working-directory: ./scripts/e2e_test | |
run: bash start_test.sh start_nexus & | |
- name: Startup minikube | |
uses: medyagh/setup-minikube@latest | |
id: minikube | |
with: | |
cache: true | |
driver: docker | |
container-runtime: docker | |
memory: 6G | |
cpus: 2 | |
wait: false | |
insecure-registry: "192.0.0.0/8,10.0.0.0/8" | |
addons: ingress,ingress-dns | |
if: ${{ matrix.server-driver == 'minikube' }} | |
- name: Overwrite configs | |
working-directory: ./scripts/e2e_test | |
run: | | |
bash start_test.sh overwrite_pip_config | |
bash start_test.sh overwrite_pypirc | |
- name: Build Console(mock index.html) | |
working-directory: ./scripts/e2e_test | |
run: bash start_test.sh build_console | |
- name: Build server docker image | |
working-directory: ./scripts/e2e_test | |
run: | | |
[ "$SERVER_DRIVER" == "minikube" ] && eval $(minikube docker-env) || true | |
bash start_test.sh build_server_image | |
env: | |
SERVER_DRIVER: ${{ matrix.server-driver }} | |
- name: Build client python package | |
working-directory: ./scripts/e2e_test | |
run: bash start_test.sh build_swcli | |
env: | |
SKIP_UI_BUILD: 1 | |
- name: Startup Starwhale Server | |
working-directory: ./scripts/e2e_test | |
run: bash start_test.sh start_starwhale | |
env: | |
SERVER_DRIVER: ${{ matrix.server-driver }} | |
- name: Check nexus service available | |
working-directory: ./scripts/e2e_test | |
run: | | |
bash start_test.sh create_service_check_file | |
bash start_test.sh check_nexus_service | |
- name: Prepare nexus repositories | |
working-directory: ./scripts/e2e_test | |
run: bash start_test.sh create_repository_in_nexus | |
- name: Upload pypi into nexus | |
working-directory: ./scripts/e2e_test | |
run: bash start_test.sh upload_pypi_to_nexus | |
- name: Setup minikube dns mock | |
working-directory: ./scripts/e2e_test | |
run: bash start_test.sh setup_minikube_dns_mock | |
if: ${{ matrix.server-driver == 'minikube' }} | |
- name: Wait and check Starwhale Server | |
working-directory: ./scripts/e2e_test | |
run: bash start_test.sh check_services_alive | |
env: | |
SERVER_DRIVER: ${{ matrix.server-driver }} | |
- name: Test OpenAPI model generating | |
working-directory: ./scripts/e2e_test | |
run: bash start_test.sh open_api_model_test | |
env: | |
SERVER_DRIVER: ${{ matrix.server-driver }} | |
- name: Test by client side | |
working-directory: ./scripts/e2e_test | |
run: bash start_test.sh client_test | |
env: | |
SKIP_UI_BUILD: 1 | |
SERVER_DRIVER: ${{ matrix.server-driver }} | |
SW_IMAGE_REPO: "ghcr.io/star-whale" | |
- name: Post output client-side test logs | |
if: failure() | |
working-directory: ./scripts/e2e_test | |
run: | | |
bash start_test.sh show_logs | |
env: | |
SERVER_DRIVER: ${{ matrix.server-driver }} | |
- name: Test by api side | |
working-directory: ./scripts/e2e_test | |
run: bash start_test.sh api_test | |
env: | |
SERVER_DRIVER: ${{ matrix.server-driver }} |