File: packaging-tests.yml

package info (click to toggle)
cloud-init 25.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,412 kB
  • sloc: python: 135,894; sh: 3,883; makefile: 141; javascript: 30; xml: 22
file content (81 lines) | stat: -rw-r--r-- 2,931 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# This test runs against packaging PRs and verifies that
# patches apply and unit tests pass.
#
# TODO: add full build-package / sbuild test
name: "Packaging (downstream branch) - patches apply cleanly unit tests pass"

on:
  pull_request:
    branches:
      - 'ubuntu/**'

concurrency:
  group: 'ci-${{ github.workflow }}-${{ github.ref }}'
  cancel-in-progress: true

defaults:
  run:
    shell: sh -ex {0}

jobs:
  patch-conflicts-upstream:
    runs-on: ubuntu-24.04
    name: Check patches apply cleanly and unit tests pass
    steps:

      - name: Setup - checkout branch
        uses: actions/checkout@v4

      - name: Setup - install dependencies
        run: |
          # This stage is slow, and unnecessecary when no series exists, so
          # only run it if necessary to save some cycles.
          # Github Actions doesn't appear to have a simple mechanism for
          # early exit without failure
          if [ ! -f debian/patches/series ]; then
            echo "no patches, skipping"
            exit 0
          fi
          sudo DEBIAN_FRONTEND=noninteractive apt-get update
          sudo DEBIAN_FRONTEND=noninteractive apt-get -y install tox quilt

      - name: Setup - Configure quilt
        run: |
          # Github Actions doesn't appear to have a simple mechanism for
          # early exit without failure
          if [ ! -f debian/patches/series ]; then
            echo "no patches, skipping"
            exit 0
          fi
          # The quilt default setting is --fuzz=2, but debian packaging has
          # stricter requirements
          sudo sed -i 's/QUILT_PUSH_ARGS=.*$/QUILT_PUSH_ARGS="--fuzz=0"/g' /etc/quilt.quiltrc
          # Standardize patches to use this format. Sorted patches reduce patch size.
          sudo sed -i 's/QUILT_REFRESH_ARGS=.*$/QUILT_REFRESH_ARGS="-p ab --no-timestamps --no-index --sort"/g' /etc/quilt.quiltrc
          # quilt defaults to QUILT_PATCHES=patches, but debian uses debian/patches
          sudo sed -i 's|.*QUILT_PATCHES=.*$|QUILT_PATCHES=debian/patches|g' /etc/quilt.quiltrc

      - name: Run test - apply patches and run unit tests
        run: |
          # Github Actions doesn't appear to have a simple mechanism for
          # early exit without failure
          if [ ! -f debian/patches/series ]; then
            echo "no patches, skipping"
            exit 0
          fi
          quilt push -a
          tox -e py3
          quilt pop -a --refresh
      - name: Enforce sorted patches
        run: |
          # Github Actions doesn't appear to have a simple mechanism for
          # early exit without failure
          if [ ! -f debian/patches/series ]; then
            echo "no patches, skipping"
            exit 0
          fi
          # check for any changes from the refresh above
          if [ -n "$(git diff)" ]; then
            # if patches were refreshed then they weren't sorted
            exit 1
          fi