|
| 1 | +name: Test Release |
| 2 | + |
| 3 | +on: [pull_request] |
| 4 | + |
| 5 | +jobs: |
| 6 | + |
| 7 | + package: |
| 8 | + runs-on: ubuntu-latest |
| 9 | + container: |
| 10 | + image: danielflook/python-minifier-build:fedora34-2021-10-05 |
| 11 | + steps: |
| 12 | + - name: Checkout |
| 13 | + uses: actions/checkout@v2 |
| 14 | + with: |
| 15 | + fetch-depth: 0 |
| 16 | + |
| 17 | + - name: Set version statically |
| 18 | + run: | |
| 19 | + VERSION="$(python3 setup.py --version)" |
| 20 | + sed -i "s/setup_requires=.*/version='$VERSION',/; s/use_scm_version=.*//" setup.py |
| 21 | +
|
| 22 | + - name: Package |
| 23 | + run: | |
| 24 | + pip3 install --upgrade setuptools wheel twine |
| 25 | + python3 setup.py sdist bdist_wheel --universal |
| 26 | +
|
| 27 | + - uses: actions/upload-artifact@v3 |
| 28 | + with: |
| 29 | + name: dist |
| 30 | + path: dist/ |
| 31 | + if-no-files-found: error |
| 32 | + |
| 33 | + test_docs: |
| 34 | + runs-on: ubuntu-latest |
| 35 | + needs: [package] |
| 36 | + container: |
| 37 | + image: danielflook/python-minifier-build:fedora34-2021-10-05 |
| 38 | + steps: |
| 39 | + - name: Checkout |
| 40 | + uses: actions/checkout@v2 |
| 41 | + |
| 42 | + - uses: actions/download-artifact@v3 |
| 43 | + with: |
| 44 | + name: dist |
| 45 | + path: dist/ |
| 46 | + |
| 47 | + - name: Build documentation |
| 48 | + run: | |
| 49 | + pip3 install sphinx sphinxcontrib-programoutput sphinx_rtd_theme |
| 50 | + pip3 install dist/*.tar.gz |
| 51 | + sphinx-build docs/source /tmp/build |
| 52 | +
|
| 53 | + test_package: |
| 54 | + runs-on: ubuntu-latest |
| 55 | + strategy: |
| 56 | + matrix: |
| 57 | + python: [2.7, 3.4, 3.5, 3.6, 3.7, 3.8] |
| 58 | + package_type: [.tar.gz, .whl] |
| 59 | + needs: [package] |
| 60 | + container: |
| 61 | + image: danielflook/python-minifier-build:fedora30-2020-05-03 |
| 62 | + steps: |
| 63 | + - name: Checkout |
| 64 | + uses: actions/checkout@v2 |
| 65 | + |
| 66 | + - uses: actions/download-artifact@v3 |
| 67 | + with: |
| 68 | + name: dist |
| 69 | + path: dist/ |
| 70 | + |
| 71 | + - name: Install package |
| 72 | + run: | |
| 73 | + if [[ "${{ matrix.python }}" == "2.7" || "${{ matrix.python }}" == "3.7" ]]; then |
| 74 | + echo "pip is already installed" |
| 75 | + elif [[ "${{ matrix.python }}" == "3.8" ]]; then |
| 76 | + curl https://bootstrap.pypa.io/get-pip.py | python${{ matrix.python }} |
| 77 | + else |
| 78 | + curl https://bootstrap.pypa.io/pip/${{ matrix.python }}/get-pip.py | python${{ matrix.python }} |
| 79 | + fi |
| 80 | + |
| 81 | + pip${{ matrix.python }} install dist/*${{ matrix.package_type }} |
| 82 | + pyminify --version |
| 83 | +
|
| 84 | + - name: Test pyminify |
| 85 | + run: | |
| 86 | + set -x |
| 87 | + cat setup.py | pyminify - |
| 88 | + pyminify setup.py > /tmp/out.min.py |
| 89 | + pyminify setup.py --output /tmp/out.min.py2 |
| 90 | + pyminify setup.py src test --in-place |
| 91 | +
|
| 92 | + test_package_3_3: |
| 93 | + runs-on: ubuntu-latest |
| 94 | + strategy: |
| 95 | + matrix: |
| 96 | + package_type: [.tar.gz, .whl] |
| 97 | + needs: [package] |
| 98 | + container: |
| 99 | + image: danielflook/python-minifier-build:fedora28-2020-05-03 |
| 100 | + steps: |
| 101 | + - name: Checkout |
| 102 | + uses: actions/checkout@v2 |
| 103 | + |
| 104 | + - uses: actions/download-artifact@v3 |
| 105 | + with: |
| 106 | + name: dist |
| 107 | + path: dist/ |
| 108 | + |
| 109 | + - name: Install package |
| 110 | + run: | |
| 111 | + curl https://bootstrap.pypa.io/pip/3.3/get-pip.py | python3.3 |
| 112 | + pip3.3 install dist/*${{ matrix.package_type }} |
| 113 | + pyminify --version |
| 114 | +
|
| 115 | + - name: Test pyminify |
| 116 | + run: | |
| 117 | + set -x |
| 118 | + cat setup.py | pyminify - |
| 119 | + pyminify setup.py > /tmp/out.min.py |
| 120 | + pyminify setup.py --output /tmp/out.min.py2 |
| 121 | + pyminify setup.py src test --in-place |
| 122 | +
|
| 123 | + test_package_3_9: |
| 124 | + runs-on: ubuntu-latest |
| 125 | + strategy: |
| 126 | + matrix: |
| 127 | + package_type: [.tar.gz, .whl] |
| 128 | + needs: [package] |
| 129 | + container: |
| 130 | + image: danielflook/python-minifier-build:fedora32-2020-10-11 |
| 131 | + steps: |
| 132 | + - name: Checkout |
| 133 | + uses: actions/checkout@v2 |
| 134 | + |
| 135 | + - uses: actions/download-artifact@v3 |
| 136 | + with: |
| 137 | + name: dist |
| 138 | + path: dist/ |
| 139 | + |
| 140 | + - name: Install package |
| 141 | + run: | |
| 142 | + pip3.9 install dist/*${{ matrix.package_type }} |
| 143 | + pyminify --version |
| 144 | +
|
| 145 | + - name: Test pyminify |
| 146 | + run: | |
| 147 | + set -x |
| 148 | + cat setup.py | pyminify - |
| 149 | + pyminify setup.py > /tmp/out.min.py |
| 150 | + pyminify setup.py --output /tmp/out.min.py2 |
| 151 | + pyminify setup.py src test --in-place |
| 152 | +
|
| 153 | + test_package_3_10: |
| 154 | + runs-on: ubuntu-latest |
| 155 | + strategy: |
| 156 | + matrix: |
| 157 | + package_type: [.tar.gz, .whl] |
| 158 | + needs: [package] |
| 159 | + container: |
| 160 | + image: danielflook/python-minifier-build:fedora34-2021-10-05 |
| 161 | + steps: |
| 162 | + - name: Checkout |
| 163 | + uses: actions/checkout@v2 |
| 164 | + |
| 165 | + - uses: actions/download-artifact@v3 |
| 166 | + with: |
| 167 | + name: dist |
| 168 | + path: dist/ |
| 169 | + |
| 170 | + - name: Install package |
| 171 | + run: | |
| 172 | + pip3.10 install dist/*${{ matrix.package_type }} |
| 173 | + pyminify --version |
| 174 | +
|
| 175 | + - name: Test pyminify |
| 176 | + run: | |
| 177 | + set -x |
| 178 | + cat setup.py | pyminify - |
| 179 | + pyminify setup.py > /tmp/out.min.py |
| 180 | + pyminify setup.py --output /tmp/out.min.py2 |
| 181 | + pyminify setup.py src test --in-place |
| 182 | +
|
| 183 | + - name: Test typing |
| 184 | + run: | |
| 185 | + pip3.10 install mypy |
| 186 | + mypy typing_test/test_typing.py |
| 187 | +
|
| 188 | + if mypy typing_test/test_badtyping.py; then |
| 189 | + echo "Bad types weren't detected" |
| 190 | + exit 1 |
| 191 | + fi |
| 192 | +
|
| 193 | + stubtest python_minifier |
0 commit comments