Browse Source

[ci] Migrate old CircleCI arm64 workflow to GA based arm64 CI workflow with py3.11 Hue build and tests (#4149)

Harsh Gupta 6 months ago
parent
commit
894067288b
2 changed files with 97 additions and 88 deletions
  1. 0 88
      .circleci/config.yml
  2. 97 0
      .github/workflows/arm64-python-ci.yml

+ 0 - 88
.circleci/config.yml

@@ -1,88 +0,0 @@
-# Python CircleCI 2.0 configuration file
-#
-# Check https://circleci.com/docs/2.0/language-python/ for more details
-#
-version: 2.1
-
-commands:
-  build-py-38-common:
-    parameters:
-      go_arch:
-        # amd64 or arm64
-        type: string
-      hugo_arch:
-        # 64bit (AMD64) or ARM64
-        type: string
-    steps:
-      - checkout
-
-      - run:
-          name: compile
-          command: |
-            sudo ln -fs /usr/share/zoneinfo/UTC /etc/localtime
-            export DEBIAN_FRONTEND=noninteractive
-            sudo apt-get update -y
-            sudo apt-get install -y gcc g++ build-essential git sudo curl
-            sudo apt-get install -y curl python3.8-dev python3.8-venv python3.8-distutils asciidoc rsync curl libkrb5-dev libldap2-dev libsasl2-dev libxml2-dev libxslt-dev  libsasl2-modules-gssapi-mit libsnappy-dev libffi-dev libncursesw5-dev libgdbm-dev libc6-dev libssl-dev openssl
-            curl -sL https://deb.nodesource.com/setup_20.x | sudo bash - && sudo apt-get install -y nodejs
-            unset PIP_FIND_LINKS
-            unset PIP_EXTRA_INDEX_URL
-            curl -sL https://bootstrap.pypa.io/get-pip.py | sudo python3.8
-
-            PYTHON_VER=python3.8 make apps docs test_prep
-
-      - run:
-          name: run documentation lints
-          command: |
-            cd ~/repo
-
-            curl -O https://dl.google.com/go/go1.23.4.linux-<< parameters.go_arch >>.tar.gz
-            tar -xvf go1.23.4.linux-<< parameters.go_arch >>.tar.gz
-            go/bin/go install github.com/raviqqe/muffet/v2@latest
-
-            curl --output hugo_0.69.0_Linux.tar.gz -L https://github.com/gohugoio/hugo/releases/download/v0.69.0/hugo_0.69.0_Linux-<< parameters.hugo_arch >>.tar.gz
-            tar -xvf hugo_0.69.0_Linux.tar.gz
-
-            export PATH=$PWD:$HOME/go/bin:$PATH
-
-            # Trigger linting if documentation changes
-            ./tools/ci/check_for_website_dead_links.sh docs/docs-site
-            # ./tools/ci/check_for_website_dead_links.sh docs/gethue
-
-      - run:
-          name: run python lints
-          command: |
-            PYTHONWARNINGS=always ./build/venvs/python3.8/bin/hue runruff check
-
-      - run:
-          name: run tests
-          command: |
-            PYTHONWARNINGS=always ./build/venvs/python3.8/bin/pytest 
-
-      - store_artifacts:
-          path: test-reports
-          destination: test-reports
-
-
-jobs:
-  build-py-38-arm64:
-    machine:
-      image: ubuntu-2004:2023.07.1
-    resource_class: arm.medium
-
-    working_directory: ~/repo
-
-    steps:
-      - build-py-38-common:
-          go_arch: "arm64"
-          hugo_arch: "ARM64"
-
-workflows:
-  version: 2
-  build-python3:
-    jobs:
-      - build-py-38-arm64:
-          filters:
-            branches:
-              ignore:
-                - master

+ 97 - 0
.github/workflows/arm64-python-ci.yml

@@ -0,0 +1,97 @@
+name: Python 3 ARM64 CI
+
+on:
+  push:
+    branches:
+    - master
+  pull_request:
+    branches:
+    - master
+
+jobs:
+  hue-build-and-tests-arm64:
+    name: Build and Test (Python 3.11, ARM64)
+    # Use GitHub-hosted ARM64 runner
+    runs-on: ubuntu-22.04-arm
+
+    steps:
+    - name: Checkout
+      uses: actions/checkout@v4
+      with:
+        fetch-depth: 0
+    
+    - name: Check commit title format
+      run: |
+        ./tools/ci/check_for_commit_message.sh
+
+    - name: Set up Python 3.11
+      uses: actions/setup-python@v5
+      with:
+        python-version: '3.11'
+
+    - name: Cache pip
+      uses: actions/cache@v4
+      with:
+        path: ~/.cache/pip
+        key: ${{ runner.os }}-arm64-py311-pip-${{ hashFiles('desktop/core/generate_requirements.py') }}
+        restore-keys: |
+          ${{ runner.os }}-arm64-py311-pip-
+          ${{ runner.os }}-arm64-py311-
+          ${{ runner.os }}-arm64-
+
+    - name: Setup node 20 and cache npm
+      uses: actions/setup-node@v4
+      with:
+        node-version: 20
+        cache: 'npm'
+
+    - name: Build Hue
+      run: |
+        sudo ln -fs /usr/share/zoneinfo/UTC /etc/localtime
+        export DEBIAN_FRONTEND=noninteractive
+        sudo apt-get update -y
+        sudo apt-get install -y build-essential asciidoc libkrb5-dev libldap2-dev libsasl2-dev libxml2-dev libxslt-dev libsasl2-modules-gssapi-mit libsnappy-dev libncursesw5-dev libgdbm-dev
+        
+        # Install Python 3.11 using deadsnakes PPA
+        sudo add-apt-repository -y ppa:deadsnakes/ppa
+        sudo apt-get install -y python3.11 python3.11-dev python3.11-venv python3.11-distutils
+        
+        # Install pip for Python 3.11
+        curl -sS https://bootstrap.pypa.io/get-pip.py | sudo python3.11
+        
+        unset PIP_FIND_LINKS
+        unset PIP_EXTRA_INDEX_URL
+
+        export PYTHON_VER=python3.11
+        export SKIP_PYTHONDEV_CHECK=true
+        export ROOT=$PWD
+        make apps docs test_prep
+
+    - name: Run documentation lint check
+      run: |
+        curl -O https://dl.google.com/go/go1.23.4.linux-arm64.tar.gz
+        tar -xvf go1.23.4.linux-arm64.tar.gz
+        go/bin/go install github.com/raviqqe/muffet/v2@latest
+
+        curl --output hugo_0.69.0_Linux.tar.gz -L https://github.com/gohugoio/hugo/releases/download/v0.69.0/hugo_0.69.0_Linux-ARM64.tar.gz
+        tar -xvf hugo_0.69.0_Linux.tar.gz
+
+        export PATH=$PWD:$HOME/go/bin:$PATH
+
+        # Trigger linting if documentation changes
+        ./tools/ci/check_for_website_dead_links.sh docs/docs-site
+        # ./tools/ci/check_for_website_dead_links.sh docs/gethue
+
+    - name: Run python lint check
+      run: |
+        PYTHONWARNINGS=always ./build/env/bin/hue runruff check
+
+    - name: Run unit tests
+      run: |
+        PYTHONWARNINGS=always ./build/env/bin/pytest
+
+    - name: Upload reports
+      uses: actions/upload-artifact@v4
+      with:
+        name: hue-reports-arm64
+        path: ./reports