|
1 | 1 | --- |
2 | | - |
3 | 2 | name: OpenWISP Controller CI Build |
4 | 3 |
|
5 | 4 | on: |
@@ -42,76 +41,76 @@ jobs: |
42 | 41 | django-version: django~=4.2.0 |
43 | 42 |
|
44 | 43 | steps: |
45 | | - - uses: actions/checkout@v4 |
46 | | - with: |
47 | | - ref: ${{ github.event.pull_request.head.sha }} |
| 44 | + - uses: actions/checkout@v4 |
| 45 | + with: |
| 46 | + ref: ${{ github.event.pull_request.head.sha }} |
48 | 47 |
|
49 | | - - name: Cache APT packages |
50 | | - uses: actions/cache@v4 |
51 | | - with: |
52 | | - path: /var/cache/apt/archives |
53 | | - key: apt-${{ runner.os }}-${{ hashFiles('.github/workflows/ci.yml') }} |
54 | | - restore-keys: | |
55 | | - apt-${{ runner.os }}- |
| 48 | + - name: Cache APT packages |
| 49 | + uses: actions/cache@v4 |
| 50 | + with: |
| 51 | + path: /var/cache/apt/archives |
| 52 | + key: apt-${{ runner.os }}-${{ hashFiles('.github/workflows/ci.yml') }} |
| 53 | + restore-keys: | |
| 54 | + apt-${{ runner.os }}- |
56 | 55 |
|
57 | | - - name: Disable man page auto-update |
58 | | - run: | |
59 | | - echo 'set man-db/auto-update false' | sudo debconf-communicate >/dev/null |
60 | | - sudo dpkg-reconfigure man-db |
| 56 | + - name: Disable man page auto-update |
| 57 | + run: | |
| 58 | + echo 'set man-db/auto-update false' | sudo debconf-communicate >/dev/null |
| 59 | + sudo dpkg-reconfigure man-db |
61 | 60 |
|
62 | | - - name: Set up Python ${{ matrix.python-version }} |
63 | | - uses: actions/setup-python@v5 |
64 | | - with: |
65 | | - python-version: ${{ matrix.python-version }} |
66 | | - cache: 'pip' |
67 | | - cache-dependency-path: | |
68 | | - **/requirements*.txt |
| 61 | + - name: Set up Python ${{ matrix.python-version }} |
| 62 | + uses: actions/setup-python@v5 |
| 63 | + with: |
| 64 | + python-version: ${{ matrix.python-version }} |
| 65 | + cache: "pip" |
| 66 | + cache-dependency-path: | |
| 67 | + **/requirements*.txt |
69 | 68 |
|
70 | | - - name: Install Dependencies |
71 | | - id: deps |
72 | | - run: | |
73 | | - sudo apt update |
74 | | - sudo apt -qq -y install sqlite3 gdal-bin libproj-dev \ |
75 | | - libgeos-dev libspatialite-dev spatialite-bin \ |
76 | | - libsqlite3-mod-spatialite |
77 | | - sudo npm install -g prettier |
78 | | - pip install -U pip wheel setuptools |
79 | | - pip install -U -r requirements-test.txt |
80 | | - pip install -U -e . |
81 | | - pip install ${{ matrix.django-version }} |
| 69 | + - name: Install Dependencies |
| 70 | + id: deps |
| 71 | + run: | |
| 72 | + sudo apt update |
| 73 | + sudo apt -qq -y install sqlite3 gdal-bin libproj-dev \ |
| 74 | + libgeos-dev libspatialite-dev spatialite-bin \ |
| 75 | + libsqlite3-mod-spatialite |
| 76 | + sudo npm install -g prettier |
| 77 | + pip install -U pip wheel setuptools |
| 78 | + pip install -U -r requirements-test.txt |
| 79 | + pip install -U -e . |
| 80 | + pip install ${{ matrix.django-version }} |
82 | 81 |
|
83 | | - - name: Start postgres and redis |
84 | | - if: ${{ !cancelled() && steps.deps.conclusion == 'success' }} |
85 | | - run: docker compose up -d postgres redis |
| 82 | + - name: Start postgres and redis |
| 83 | + if: ${{ !cancelled() && steps.deps.conclusion == 'success' }} |
| 84 | + run: docker compose up -d postgres redis |
86 | 85 |
|
87 | | - - name: QA checks |
88 | | - run: ./run-qa-checks |
| 86 | + - name: QA checks |
| 87 | + run: ./run-qa-checks |
89 | 88 |
|
90 | | - - name: Tests |
91 | | - if: ${{ !cancelled() && steps.deps.conclusion == 'success' }} |
92 | | - run: | |
93 | | - coverage run runtests.py --parallel || coverage run ./runtests.py |
94 | | - # tests the extension capability |
95 | | - SAMPLE_APP=1 coverage run ./runtests.py --parallel --keepdb --exclude-tag=selenium_tests \ |
96 | | - || SAMPLE_APP=1 coverage run ./runtests.py --keepdb --exclude-tag=selenium_tests |
97 | | - coverage combine |
98 | | - coverage xml |
99 | | - env: |
100 | | - SELENIUM_HEADLESS: 1 |
101 | | - GECKO_LOG: 1 |
| 89 | + - name: Tests |
| 90 | + if: ${{ !cancelled() && steps.deps.conclusion == 'success' }} |
| 91 | + run: | |
| 92 | + coverage run runtests.py --parallel || coverage run ./runtests.py |
| 93 | + # tests the extension capability |
| 94 | + SAMPLE_APP=1 coverage run ./runtests.py --parallel --keepdb --exclude-tag=selenium_tests \ |
| 95 | + || SAMPLE_APP=1 coverage run ./runtests.py --keepdb --exclude-tag=selenium_tests |
| 96 | + coverage combine |
| 97 | + coverage xml |
| 98 | + env: |
| 99 | + SELENIUM_HEADLESS: 1 |
| 100 | + GECKO_LOG: 1 |
102 | 101 |
|
103 | | - - name: Show gecko web driver log on failures |
104 | | - if: ${{ failure() }} |
105 | | - run: cat geckodriver.log |
| 102 | + - name: Show gecko web driver log on failures |
| 103 | + if: ${{ failure() }} |
| 104 | + run: cat geckodriver.log |
106 | 105 |
|
107 | | - - name: Upload Coverage |
108 | | - if: ${{ success() }} |
109 | | - uses: coverallsapp/github-action@v2 |
110 | | - with: |
111 | | - parallel: true |
112 | | - format: cobertura |
113 | | - flag-name: python-${{ matrix.env.env }} |
114 | | - github-token: ${{ secrets.GITHUB_TOKEN }} |
| 106 | + - name: Upload Coverage |
| 107 | + if: ${{ success() }} |
| 108 | + uses: coverallsapp/github-action@v2 |
| 109 | + with: |
| 110 | + parallel: true |
| 111 | + format: cobertura |
| 112 | + flag-name: python-${{ matrix.env.env }} |
| 113 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
115 | 114 |
|
116 | 115 | coveralls: |
117 | 116 | needs: build |
|
0 commit comments