From 44b3d1a64752e6f7f78433ca5879c070d98608d2 Mon Sep 17 00:00:00 2001 From: Marlon Saglia Date: Wed, 14 Aug 2024 15:55:00 +0200 Subject: [PATCH] chore: move to reusable workflow --- .github/actions/free-space/action.yml | 36 ------------- .github/actions/install-deps/action.yml | 26 ---------- .../verify-guides-billion-vector.yml | 4 +- .github/workflows/verify-guides-main.yml | 2 +- .github/workflows/verify-guides.yml | 51 ------------------- 5 files changed, 4 insertions(+), 115 deletions(-) delete mode 100644 .github/actions/free-space/action.yml delete mode 100644 .github/actions/install-deps/action.yml delete mode 100644 .github/workflows/verify-guides.yml diff --git a/.github/actions/free-space/action.yml b/.github/actions/free-space/action.yml deleted file mode 100644 index 5c1f946a4..000000000 --- a/.github/actions/free-space/action.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Free disk space -description: Frees some disk space on the runner. - -runs: - using: "composite" - steps: - - name: Remove Android library (~14GiB) - shell: bash - run: | - sudo rm -rf /usr/local/lib/android|| true - - - name: Remove .Net runtime (~2.7GiB) - shell: bash - run: | - sudo rm -rf /usr/share/dotnet|| true - - - name: Remove misc large packages (~5.3GiB) - shell: bash - run: | - sudo apt-get remove -yq --fix-missing --autoremove '^aspnetcore-.*' || true - sudo apt-get remove -yq --fix-missing --autoremove '^dotnet-.*' || true - sudo apt-get remove -yq --fix-missing --autoremove '^llvm-.*' || true - sudo apt-get remove -yq --fix-missing --autoremove '^mongodb-.*' || true - sudo apt-get remove -yq --fix-missing --autoremove '^google-cloud-*' || true - sudo apt-get remove -yq --fix-missing --autoremove php-common php-pear|| true - sudo apt-get remove -yq --fix-missing --autoremove mysql-common || true - sudo apt-get remove -yq --fix-missing --autoremove azure-cli powershell mono-devel libgl1-mesa-dri|| true - sudo apt-get remove -yq --fix-missing --autoremove google-chrome-stable firefox microsoft-edge-stable|| true - sudo apt-get remove -yq --fix-missing --autoremove snapd|| true - sudo apt-get autoremove -yq|| true - sudo apt-get clean|| true - - - name: Remove Tool Cache (~5.9GiB) - shell: bash - run: | - sudo rm -rf "$AGENT_TOOLSDIRECTORY"|| true diff --git a/.github/actions/install-deps/action.yml b/.github/actions/install-deps/action.yml deleted file mode 100644 index 011dd3e40..000000000 --- a/.github/actions/install-deps/action.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: "Setup Vespa CLI and dependencies" -description: "Install Vespa CLI and dependencies" - -runs: - using: "composite" - steps: - # - name: Setup Ruby - # uses: ruby/setup-ruby@v1 - # with: - # ruby-version: 3.1 - # bundler-cache: true - - - uses: actions/setup-java@v4 - with: - distribution: "temurin" - java-version: "17" - - - name: Install python dependencies - shell: bash - run: | - python3 -m pip install --upgrade pip - python3 -m pip install -qqq -r test/requirements.txt --user - python3 -m pip install -qqq pytest nbmake --user - - - name: Install Vespa CLI - uses: vespa-engine/setup-vespa-cli-action@v1 diff --git a/.github/workflows/verify-guides-billion-vector.yml b/.github/workflows/verify-guides-billion-vector.yml index 9dbd99600..33cda22c9 100644 --- a/.github/workflows/verify-guides-billion-vector.yml +++ b/.github/workflows/verify-guides-billion-vector.yml @@ -6,15 +6,17 @@ on: push: branches: ["master"] paths: + - ".github/workflows/verify-guides-billion-vector.yml" # Test changes to this file - "billion-scale-vector-search/" pull_request: branches: ["master"] paths: + - ".github/workflows/verify-guides-billion-vector.yml" # Test changes to this file - "billion-scale-vector-search/" jobs: main: - uses: ./.github/workflows/verify-guides.yml + uses: vespa-engine/gh-actions/.github/workflows/verify-markdown-guides.yml@verify-markdown-guides with: test-file: "billion-scale-vector-search/README.md" diff --git a/.github/workflows/verify-guides-main.yml b/.github/workflows/verify-guides-main.yml index 217444f95..0fe525e10 100644 --- a/.github/workflows/verify-guides-main.yml +++ b/.github/workflows/verify-guides-main.yml @@ -19,6 +19,6 @@ on: jobs: main: - uses: ./.github/workflows/verify-guides.yml + uses: vespa-engine/gh-actions/.github/workflows/verify-markdown-guides.yml@verify-markdown-guides with: test-config-path: "test/_test_config.yml" diff --git a/.github/workflows/verify-guides.yml b/.github/workflows/verify-guides.yml deleted file mode 100644 index 3e6e8817c..000000000 --- a/.github/workflows/verify-guides.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: Verify Giudes - -on: - workflow_call: - inputs: - test-config-path: - description: | - The path to the test configuration file, relative to the repository root. - - ::warning:: This is mutually exclusive with `test-file`. - - Example: `test/_test_config.yml` - type: string - required: false - test-file: - description: | - The path to the test file, relative to the repository root. This is used to run tests for a specific guide. - - ::warning:: This is mutually exclusive with `test-config-path` and will take precedence over it. - - Example: `billion-scale-vector-search/README.md` - type: string - required: false - -defaults: - run: - # Specify to ensure "pipefail and errexit" are set. - # Ref: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#defaultsrunshell - shell: bash - -jobs: - test: - runs-on: ubuntu-latest - env: - LANG: "C.UTF-8" - steps: - - uses: actions/checkout@v4 - - - uses: ./.github/actions/free-space - - - uses: ./.github/actions/install-deps - - - name: run-tests (config) - if: ${{ inputs.test-config-path && !inputs.test-file }} - run: | - ./test/test.py -w $GITHUB_WORKSPACE -c ${{ inputs.test-config-path }} - - - name: run-tests (file) - if: ${{ inputs.test-file && !inputs.test-config-path }} - run: | - ./test/test.py -w $GITHUB_WORKSPACE ${{ inputs.test-file }}