|
1 | 1 | name:Testing python-mode |
2 | 2 |
|
3 | | -on:[push] |
| 3 | +on: |
| 4 | +push: |
| 5 | +branches:[main, master, develop] |
| 6 | +pull_request: |
| 7 | +branches:[main, master, develop] |
4 | 8 |
|
5 | 9 | jobs: |
6 | | -test-python-3_8: |
| 10 | +test-python-versions: |
7 | 11 | runs-on:ubuntu-latest |
| 12 | +strategy: |
| 13 | +matrix: |
| 14 | +python_version: |
| 15 | + -short:"3.10" |
| 16 | +full:"3.10.13" |
| 17 | + -short:"3.11" |
| 18 | +full:"3.11.9" |
| 19 | + -short:"3.12" |
| 20 | +full:"3.12.4" |
| 21 | + -short:"3.13" |
| 22 | +full:"3.13.0" |
| 23 | +fail-fast:false |
| 24 | +name:Test Python ${{ matrix.python_version.short }} (${{ matrix.python_version.full }}) |
8 | 25 | steps: |
9 | | - -uses:actions/checkout@v1 |
10 | | - -name:Install dependencies |
11 | | -run:| |
12 | | - sudo apt update |
13 | | - export PYTHON_CONFIGURE_OPTS="--enable-shared" |
14 | | - sudo apt install -yqq libncurses5-dev libgtk2.0-dev libatk1.0-dev libcairo2-dev libx11-dev libxpm-dev libxt-dev python3-dev lua5.2 liblua5.2-dev libperl-dev git |
15 | | - sudo apt remove --purge -yqq vim vim-runtime gvim |
16 | | - -name:build and install vim from source |
17 | | -working-directory:/tmp |
18 | | -run:| |
19 | | - export PYTHON_CONFIGURE_OPTS="--enable-shared" |
20 | | - git clone https://github.com/vim/vim.git |
21 | | - cd vim |
22 | | - ./configure --with-features=huge --enable-multibyte --enable-python3interp=yes --with-python3-config-dir=/usr/lib/python3.8/config-3.8m-x86_64-linux-gnu --enable-perlinterp=yes --enable-luainterp=yes --enable-cscope --prefix=/usr/local |
23 | | - sudo make && sudo make install |
24 | | - -name:Install python-mode |
25 | | -run:| |
26 | | - export PYMODE_DIR="${HOME}/work/python-mode/python-mode" |
27 | | - mkdir -p ${HOME}/.vim/pack/foo/start/ |
28 | | - ln -s ${PYMODE_DIR} ${HOME}/.vim/pack/foo/start/python-mode |
29 | | - cp ${PYMODE_DIR}/tests/utils/pymoderc ${HOME}/.pymoderc |
30 | | - cp ${PYMODE_DIR}/tests/utils/vimrc ${HOME}/.vimrc |
31 | | - touch ${HOME}/.vimrc.before ${HOME}/.vimrc.after |
32 | | - -name:Run python-mode test script |
33 | | -run:| |
34 | | - alias python=python3 |
35 | | - cd ${HOME}/work/python-mode/python-mode |
36 | | - git submodule update --init --recursive |
37 | | - git submodule sync |
38 | | - bash tests/test.sh |
39 | | -test-python-3_9: |
40 | | -runs-on:ubuntu-latest |
41 | | -steps: |
42 | | - -uses:actions/checkout@v1 |
43 | | - -name:Install dependencies |
44 | | -run:| |
45 | | - sudo apt update |
46 | | - export PYTHON_CONFIGURE_OPTS="--enable-shared" |
47 | | - sudo apt install -yqq libncurses5-dev libgtk2.0-dev libatk1.0-dev libcairo2-dev libx11-dev libxpm-dev libxt-dev python3-dev lua5.2 liblua5.2-dev libperl-dev git |
48 | | - sudo apt remove --purge -yqq vim vim-runtime gvim |
49 | | - -name:build and install vim from source |
50 | | -working-directory:/tmp |
51 | | -run:| |
52 | | - export PYTHON_CONFIGURE_OPTS="--enable-shared" |
53 | | - git clone https://github.com/vim/vim.git |
54 | | - cd vim |
55 | | - ./configure --with-features=huge --enable-multibyte --enable-python3interp=yes --with-python3-config-dir=/usr/lib/python3.9/config-3.9m-x86_64-linux-gnu --enable-perlinterp=yes --enable-luainterp=yes --enable-cscope --prefix=/usr/local |
56 | | - sudo make && sudo make install |
57 | | - -name:Install python-mode |
58 | | -run:| |
59 | | - export PYMODE_DIR="${HOME}/work/python-mode/python-mode" |
60 | | - mkdir -p ${HOME}/.vim/pack/foo/start/ |
61 | | - ln -s ${PYMODE_DIR} ${HOME}/.vim/pack/foo/start/python-mode |
62 | | - cp ${PYMODE_DIR}/tests/utils/pymoderc ${HOME}/.pymoderc |
63 | | - cp ${PYMODE_DIR}/tests/utils/vimrc ${HOME}/.vimrc |
64 | | - touch ${HOME}/.vimrc.before ${HOME}/.vimrc.after |
65 | | - -name:Run python-mode test script |
66 | | -run:| |
67 | | - alias python=python3 |
68 | | - cd ${HOME}/work/python-mode/python-mode |
69 | | - git submodule update --init --recursive |
70 | | - git submodule sync |
71 | | - bash tests/test.sh |
| 26 | + -name:Checkout repository |
| 27 | +uses:actions/checkout@v4 |
| 28 | +with: |
| 29 | +submodules:recursive |
| 30 | + |
| 31 | + -name:Set up Docker Buildx |
| 32 | +uses:docker/setup-buildx-action@v3 |
| 33 | + |
| 34 | + -name:Build Docker image |
| 35 | +run:| |
| 36 | + docker compose build -q \ |
| 37 | + --build-arg PYTHON_VERSION="${{ matrix.python_version.full }}" \ |
| 38 | + --build-arg PYTHON_VERSION_SHORT="${{ matrix.python_version.short }}" \ |
| 39 | + python-mode-tests |
| 40 | +
|
| 41 | + -name:Run tests with Python ${{ matrix.python_version.short }} |
| 42 | +run:| |
| 43 | + docker compose run --rm \ |
| 44 | + -e PYTHON_VERSION="${{ matrix.python_version.full }}" \ |
| 45 | + -e PYTHON_VERSION_SHORT="${{ matrix.python_version.short }}" \ |
| 46 | + python-mode-tests |