From a1a56b5d16a8dc1c0a65f0b9c8c01730fe8a6ae6 Mon Sep 17 00:00:00 2001 From: eq19 Date: Sat, 22 Jun 2024 09:48:37 +0000 Subject: [PATCH] main.yml --- .github/workflows/alpine-unittests.yml | 74 ---------------- .github/workflows/check_format.yml | 114 ------------------------- .github/workflows/cla.yml | 40 --------- .github/workflows/doc-autolabel.yml | 12 --- .github/workflows/integration.yml | 89 ------------------- .github/workflows/linkcheck.yml | 39 --------- .github/workflows/main.yml | 0 .github/workflows/scheduled.yml | 59 ------------- .github/workflows/stale.yml | 24 ------ .github/workflows/unit.yml | 45 ---------- 10 files changed, 496 deletions(-) delete mode 100644 .github/workflows/alpine-unittests.yml delete mode 100644 .github/workflows/check_format.yml delete mode 100644 .github/workflows/cla.yml delete mode 100644 .github/workflows/doc-autolabel.yml delete mode 100644 .github/workflows/integration.yml delete mode 100644 .github/workflows/linkcheck.yml create mode 100644 .github/workflows/main.yml delete mode 100644 .github/workflows/scheduled.yml delete mode 100644 .github/workflows/stale.yml delete mode 100644 .github/workflows/unit.yml diff --git a/.github/workflows/alpine-unittests.yml b/.github/workflows/alpine-unittests.yml deleted file mode 100644 index eac2c7a81e4..00000000000 --- a/.github/workflows/alpine-unittests.yml +++ /dev/null @@ -1,74 +0,0 @@ - -name: Alpine Unittests - -on: - pull_request: - branches-ignore: - - 'ubuntu/**' - push: - branches: - - main - -concurrency: - group: 'ci-${{ github.workflow }}-${{ github.ref }}' - cancel-in-progress: true - -defaults: - run: - shell: sh -ex {0} - -jobs: - build: - runs-on: ubuntu-latest - steps: - - - name: "Checkout" - uses: actions/checkout@v4 - with: - # Fetch all tags for tools/read-version - fetch-depth: 0 - - - name: Setup LXD - uses: canonical/setup-lxd@v0.1.1 - with: - channel: latest/candidate - - - name: Create alpine container - # the current shell doesn't have lxd as one of the groups - # so switch groups to run lxd commands - run: lxc launch images:alpine/edge alpine - - - name: Check networking (for debugging) - run: | - lxc exec alpine -- ping -c 1 google.com || true - lxc exec alpine -- ping -c 1 dl-cdn.alpinelinux.org || true - lxc exec alpine -- nslookup www.google.com || true - lxc exec alpine -- ping -c 1 dl-cdn.alpinelinux.org || true - - - name: Install dependencies - run: lxc exec alpine -- apk add py3-tox git tzdata - - - name: Mount source into container directory - run: lxc config device add alpine gitdir disk source=$(pwd) path=/root/cloud-init-ro - - - name: Create a r/w directory to run tests in - # without this, tox fails during package install - run: | - lxc exec alpine -- git config --global --add safe.directory /root/cloud-init-ro/.git - lxc exec alpine -- git clone cloud-init-ro cloud-init-rw - - - name: Set a timezone - # test for regression of GH-5158 - # https://github.com/canonical/cloud-init/issues/5158 - run: lxc exec alpine -- ln -s /usr/share/zoneinfo/Europe/Brussels /etc/localtime - - - name: Set up tox environment - # Setup the environment and then tell pytest to do essentially nothing - run: lxc exec alpine --cwd /root/cloud-init-rw -- tox -e py3 -- --cache-show= - - - name: Stop network - # Take down network interfaces to ensure tests don't use network - run: lxc exec alpine -- ifdown -a - - - name: Run unittests - run: lxc exec alpine --cwd /root/cloud-init-rw -- tox -e py3 diff --git a/.github/workflows/check_format.yml b/.github/workflows/check_format.yml deleted file mode 100644 index ba44e665811..00000000000 --- a/.github/workflows/check_format.yml +++ /dev/null @@ -1,114 +0,0 @@ -name: Lint Tests -on: - pull_request: - push: - branches: - - main - -concurrency: - group: 'ci-${{ github.workflow }}-${{ github.ref }}' - cancel-in-progress: true -defaults: - run: - shell: sh -ex {0} - -jobs: - check_format: - strategy: - fail-fast: false - matrix: - env: [ruff, mypy, pylint, black, isort] - name: Check ${{ matrix.env }} - runs-on: ubuntu-20.04 - steps: - - name: "Checkout #1" - uses: actions/checkout@v3.0.0 - - - name: "Checkout #2 (for tools/read-version)" - run: | - git fetch --unshallow - git remote add upstream https://git.launchpad.net/cloud-init - - - name: Dependencies - run: | - sudo DEBIAN_FRONTEND=noninteractive apt-get -qy update - sudo DEBIAN_FRONTEND=noninteractive apt-get -qy install tox - - - name: Print version - run: python3 --version - - - name: Test - env: - # matrix env: not to be confused w/environment variables or testenv - TOXENV: ${{ matrix.env }} - run: tox - schema-format: - strategy: - fail-fast: false - name: Check json format - runs-on: ubuntu-22.04 - steps: - - name: "Checkout #1" - uses: actions/checkout@v3.0.0 - - - name: "Test format" - run: | - tools/check_json_format.sh cloudinit/config/schemas/schema-cloud-config-v1.json - tools/check_json_format.sh cloudinit/config/schemas/schema-network-config-v1.json - tools/check_json_format.sh cloudinit/config/schemas/versions.schema.cloud-config.json - - doc: - strategy: - fail-fast: false - name: Check docs - runs-on: ubuntu-22.04 - steps: - - name: "Checkout #1" - uses: actions/checkout@v3.0.0 - - - name: "Checkout #2 (for tools/read-version)" - run: | - git fetch --unshallow - git remote add upstream https://git.launchpad.net/cloud-init - - name: "Install Python 3.10" - uses: actions/setup-python@v4 - with: - python-version: '3.10.8' - - name: "Install dependencies" - run: | - sudo DEBIAN_FRONTEND=noninteractive apt-get -qy update - sudo DEBIAN_FRONTEND=noninteractive apt-get -qy install tox - - name: "Spellcheck" - run: | - tox - env: - TOXENV: doc-spelling - - name: "Build docs" - env: - TOXENV: doc - run: | - tox - - shell-lint: - name: Shell Lint - runs-on: ubuntu-22.04 - steps: - - name: Checkout - uses: actions/checkout@v3.0.0 - - - name: Install ShellCheck - run: | - sudo apt-get update - sudo apt install shellcheck - - - name: Run ShellCheck - run: | - shellcheck ./tools/ds-identify - - check-cla-signers: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3.0.0 - - - name: Check CLA signers file - run: tools/check-cla-signers diff --git a/.github/workflows/cla.yml b/.github/workflows/cla.yml deleted file mode 100644 index fd438b2106e..00000000000 --- a/.github/workflows/cla.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Verify Contributor License Agreement - -on: [pull_request] - -jobs: - cla-validate: - - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - name: Check CLA signing status for ${{ github.event.pull_request.user.login }} - run: | - cat > unsigned-cla.txt < /home/$USER/.config/pycloudlib.toml - sudo adduser $USER lxd - # Jammy GH Action runners have docker installed, which edits iptables - # in a way that is incompatible with lxd. - # https://documentation.ubuntu.com/lxd/en/latest/howto/network_bridge_firewalld/#prevent-connectivity-issues-with-lxd-and-docker - sudo iptables -I DOCKER-USER -j ACCEPT - sudo lxd init --auto - - name: Run integration Tests - run: | - sg lxd -c 'CLOUD_INIT_CLOUD_INIT_SOURCE="$(ls cloud-init*.deb)" tox -e integration-tests-ci' diff --git a/.github/workflows/linkcheck.yml b/.github/workflows/linkcheck.yml deleted file mode 100644 index aeae6840a46..00000000000 --- a/.github/workflows/linkcheck.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: scheduled-linkcheck -on: - schedule: - - cron: '3 14 * * *' -concurrency: - group: 'ci-${{ github.workflow }}-${{ github.ref }}' - cancel-in-progress: true - -jobs: - linkcheck: - runs-on: ubuntu-22.04 - continue-on-error: ${{ !(github.event_name == 'workflow_dispatch' && github.event.inputs.failOnError == 'true') }} - - steps: - - name: Checkout Repository - uses: actions/checkout@v3.0.0 - - - name: "Install Python 3.10" - uses: actions/setup-python@v4 - with: - python-version: '3.10.8' - - - name: Install tox - run: pip install tox - - - name: Run Sphinx linkcheck - run: tox -e linkcheck | tee output.txt - - - name: Check for broken links below threshold - run: | - broken_count=$(grep -c "broken" output.txt) - if [[ $broken_count -ge 5 ]]; then - echo "Too many broken links detected: $broken_count" - broken_matches=$(grep "broken" output.txt) - echo "Broken links \n$broken_matches" - exit 1 - else - echo "Number of broken links is below threshold: $broken_count" - fi diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000000..e69de29bb2d diff --git a/.github/workflows/scheduled.yml b/.github/workflows/scheduled.yml deleted file mode 100644 index aca4f9b7e87..00000000000 --- a/.github/workflows/scheduled.yml +++ /dev/null @@ -1,59 +0,0 @@ -name: scheduled-daily -on: - schedule: - - cron: '3 14 * * *' -concurrency: - group: 'ci-${{ github.workflow }}-${{ github.ref }}' - cancel-in-progress: false - -jobs: - hypothesis: - name: unittest / hypothesis-slow - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Install dependencies - env: - DEBIAN_FRONTEND: noninteractive - run: | - sudo apt-get -qy update - sudo apt-get -qy install tox - - name: Run fuzztest - env: - PYTEST_ADDOPTS: -v - HYPOTHESIS_PROFILE: ci - run: tox -e hypothesis-slow - devel_tests: - name: unittest / 3.13-dev - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Install Python 3.13-dev - uses: actions/setup-python@v4 - with: - python-version: 3.13-dev - check-latest: true - - name: Install tox - run: pip install tox - - name: Run unittest - run: tox -e py3 - format_tip: - strategy: - fail-fast: false - matrix: - env: [tip-ruff, tip-mypy, tip-pylint, tip-black, tip-isort] - name: format-tip - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Install dependencies - run: | - sudo apt-get -qy update - sudo apt-get -qy install tox - - name: Run Linters tip - env: - TOXENV: ${{ matrix.env }} - run: tox diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml deleted file mode 100644 index c763dafded7..00000000000 --- a/.github/workflows/stale.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Mark and close stale pull requests - -on: - schedule: - - cron: "0 0 * * *" # Daily @ 00:00 - -jobs: - stale: - - runs-on: ubuntu-latest - - steps: - - uses: actions/stale@v1 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - days-before-stale: 14 - days-before-close: 7 - stale-pr-message: | - Hello! Thank you for this proposed change to cloud-init. This pull request is now marked as stale as it has not seen any activity in 14 days. If no activity occurs within the next 7 days, this pull request will automatically close. - - If you are waiting for code review and you are seeing this message, apologies! Please reply, tagging TheRealFalcon, and he will ensure that someone takes a look soon. - - (If the pull request is closed and you would like to continue working on it, please do tag TheRealFalcon to reopen it.) - stale-pr-label: 'stale-pr' diff --git a/.github/workflows/unit.yml b/.github/workflows/unit.yml deleted file mode 100644 index 5eda03c8e63..00000000000 --- a/.github/workflows/unit.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Unit Tests -on: - pull_request: - push: - branches: - - main -concurrency: - group: 'ci-${{ github.workflow }}-${{ github.ref }}' - cancel-in-progress: true -defaults: - run: - shell: sh -ex {0} -jobs: - unittests: - strategy: - matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] - toxenv: [py3] - experimental: [false] - check-latest: [false] - continue-on-error: [false] - include: - - python-version: "3.6" - toxenv: lowest-supported - continue-on-error: false - check-latest: false - experimental: false - name: unittest / ${{ matrix.toxenv }} / python ${{matrix.python-version}} - runs-on: ubuntu-20.04 - continue-on-error: ${{ matrix.experimental }} - steps: - - name: "Checkout" - uses: actions/checkout@v4 - with: - # Fetch all tags for tools/read-version - fetch-depth: 0 - - name: Install Python ${{matrix.python-version}} - uses: actions/setup-python@v4 - with: - python-version: ${{matrix.python-version}} - check-latest: ${{matrix.check-latest}} - - name: Install tox - run: pip install tox - - name: Run unittest - run: tox -e ${{ matrix.toxenv }}