From dccb1dfde9d68ddeb87ecb4b89bf29962f0f65a0 Mon Sep 17 00:00:00 2001 From: Paul Meyer <49727155+katexochen@users.noreply.github.com> Date: Thu, 3 Aug 2023 15:05:04 +0200 Subject: [PATCH] ci: remove unused actions Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com> --- .github/actions/install_docgen/action.yml | 26 --------- .../actions/install_operator_sdk/action.yml | 24 -------- .github/actions/setup_linux/action.yml | 57 ------------------- ...h_action.sh.in => unused_gh_actions.sh.in} | 44 +++++++------- 4 files changed, 22 insertions(+), 129 deletions(-) delete mode 100644 .github/actions/install_docgen/action.yml delete mode 100644 .github/actions/install_operator_sdk/action.yml delete mode 100644 .github/actions/setup_linux/action.yml rename bazel/ci/{unused_gh_action.sh.in => unused_gh_actions.sh.in} (55%) diff --git a/.github/actions/install_docgen/action.yml b/.github/actions/install_docgen/action.yml deleted file mode 100644 index 0d78941e9..000000000 --- a/.github/actions/install_docgen/action.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Install Docgen -description: | - Install Docgen -runs: - using: "composite" - steps: - - name: Checkout talos - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 - with: - fetch-depth: 0 - repository: "siderolabs/talos" - ref: "v1.3.1" - path: talos - - # This is required to be able to build docgen - - name: Remove go.work - shell: bash - working-directory: talos - run: rm go.work* - - - name: Install Docgen - shell: bash - working-directory: talos/hack/docgen - run: | - go build -o docgen . - mv docgen /usr/local/bin diff --git a/.github/actions/install_operator_sdk/action.yml b/.github/actions/install_operator_sdk/action.yml deleted file mode 100644 index 7801ca8a9..000000000 --- a/.github/actions/install_operator_sdk/action.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Install operator-sdk -description: | - Installs the operator-sdk binary. -inputs: - version: - description: "Version of the operator-sdk to install" - required: true -runs: - using: "composite" - steps: - - name: Install operator-sdk - shell: bash - run: | - export ARCH=$(case $(uname -m) in x86_64) echo -n amd64 ;; aarch64) echo -n arm64 ;; *) echo -n $(uname -m) ;; esac) - export OS=$(uname | awk '{print tolower($0)}') - export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/${{ inputs.version }} - curl -fsSLO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH} - gpg --keyserver keyserver.ubuntu.com --recv-keys 052996E2A20B5C7E - curl -fsSLO ${OPERATOR_SDK_DL_URL}/checksums.txt - curl -fsSLO ${OPERATOR_SDK_DL_URL}/checksums.txt.asc - gpg -u "Operator SDK (release) " --verify checksums.txt.asc - grep operator-sdk_${OS}_${ARCH} checksums.txt | sha256sum -c - - chmod +x operator-sdk_${OS}_${ARCH} && sudo mv operator-sdk_${OS}_${ARCH} /usr/local/bin/operator-sdk - rm checksums.txt checksums.txt.asc diff --git a/.github/actions/setup_linux/action.yml b/.github/actions/setup_linux/action.yml deleted file mode 100644 index 4a9b0cbd2..000000000 --- a/.github/actions/setup_linux/action.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: Setup Linux build environment -description: "Setup a Linux Build environment (for self-hosted runners)" -runs: - using: "composite" - steps: - - name: Setup custom apt repositories (azure-cli & yq) - shell: bash - run: | - sudo apt-get update - sudo apt-get install ca-certificates curl apt-transport-https lsb-release gnupg -y - curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | - gpg --dearmor | - sudo tee /etc/apt/trusted.gpg.d/microsoft.gpg > /dev/null - AZ_REPO=$(lsb_release -cs) - echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $AZ_REPO main" | - sudo tee /etc/apt/sources.list.d/azure-cli.list - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys CC86BB64 - sudo add-apt-repository ppa:rmescandon/yq - - - name: Update apt repository information - shell: bash - run: | - sudo apt-get update - - - name: Install build-essential & CMake - shell: bash - run: | - sudo apt-get install \ - build-essential cmake \ - -y - - - name: Install curl gpg - shell: bash - run: | - sudo apt-get install curl gpg -y - - - name: Install yq jq - shell: bash - run: | - sudo apt-get install yq jq -y - - - name: Install AWS CLI - shell: bash - run: | - sudo apt-get -y install awscli - - - name: Install az CLI - shell: bash - run: | - sudo apt-get install azure-cli -y - - - name: Set up gcloud CLI - uses: google-github-actions/setup-gcloud@e30db14379863a8c79331b04a9969f4c1e225e0b # v1.1.1 - - - name: Set up Docker Buildx - id: docker-setup - uses: docker/setup-buildx-action@16c0bc4a6e6ada2cfd8afd41d22d95379cf7c32a # v2.8.0 diff --git a/bazel/ci/unused_gh_action.sh.in b/bazel/ci/unused_gh_actions.sh.in similarity index 55% rename from bazel/ci/unused_gh_action.sh.in rename to bazel/ci/unused_gh_actions.sh.in index 7d87ca45a..a4f2a5fd3 100755 --- a/bazel/ci/unused_gh_action.sh.in +++ b/bazel/ci/unused_gh_actions.sh.in @@ -19,41 +19,41 @@ cd "${BUILD_WORKSPACE_DIRECTORY}" # .github/actions that are not used in any workflow or action YAML. # We only want directory of that exact level and ignore subdirectories. actionNames=$( - find .github/actions \ - -maxdepth 2 \ - -type d \ - ! -name actions + find .github/actions \ + -maxdepth 2 \ + -type d \ + ! -name actions ) actionYMLs=$( - find .github/actions \ - ! -name actions \ - -type f \ - -name '*.yml' + find .github/actions \ + ! -name actions \ + -type f \ + -name '*.yml' ) workflowYMLs=$( - find .github/workflows \ - -type f \ - -name '*.yml' + find .github/workflows \ + -type f \ + -name '*.yml' ) exitcode=0 for action in ${actionNames}; do - used=false + used=false - for yml in ${actionYMLs} ${workflowYMLs}; do - if grep -q "${action}" "${yml}"; then - used=true - break - fi - done - - if ! ${used}; then - echo "Action ${action} is unused" - exitcode=1 + for yml in ${actionYMLs} ${workflowYMLs}; do + if grep -q "${action}" "${yml}"; then + used=true + break fi + done + + if ! ${used}; then + echo "Action ${action} is unused" + exitcode=1 + fi done exit "${exitcode}"