|
| 1 | +name: "In-place git pull from master" |
| 2 | + |
| 3 | +# any branch is useful for testing before a PR is submitted |
| 4 | +on: [push, pull_request] |
| 5 | + |
| 6 | +jobs: |
| 7 | + withpluginsLinux: |
| 8 | + # run on pushes to any branch |
| 9 | + # run on PRs from external forks |
| 10 | + if: | |
| 11 | + (github.event_name != 'pull_request') |
| 12 | + || (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id) |
| 13 | + name: Linux with Plugins |
| 14 | + runs-on: ubuntu-latest |
| 15 | + |
| 16 | + strategy: |
| 17 | + fail-fast: false |
| 18 | + matrix: |
| 19 | + node: [10, 12, 14, 15] |
| 20 | + |
| 21 | + steps: |
| 22 | + - name: Checkout master repository |
| 23 | + uses: actions/checkout@v2 |
| 24 | + with: |
| 25 | + ref: master |
| 26 | + |
| 27 | + - uses: actions/setup-node@v2 |
| 28 | + with: |
| 29 | + node-version: ${{ matrix.node }} |
| 30 | + |
| 31 | + - name: Install Etherpad plugins |
| 32 | + # The --legacy-peer-deps flag is required to work around a bug in npm v7: |
| 33 | + # https://github.com/npm/cli/issues/2199 |
| 34 | + run: > |
| 35 | + npm install --no-save --legacy-peer-deps |
| 36 | + ep_align |
| 37 | + ep_author_hover |
| 38 | + ep_cursortrace |
| 39 | + ep_font_size |
| 40 | + ep_hash_auth |
| 41 | + ep_headings2 |
| 42 | + ep_image_upload |
| 43 | + ep_markdown |
| 44 | + ep_readonly_guest |
| 45 | + ep_set_title_on_pad |
| 46 | + ep_spellcheck |
| 47 | + ep_subscript_and_superscript |
| 48 | + ep_table_of_contents |
| 49 | +
|
| 50 | + # This must be run after installing the plugins, otherwise npm will try to |
| 51 | + # hoist common dependencies by removing them from src/node_modules and |
| 52 | + # installing them in the top-level node_modules. As of v6.14.10, npm's hoist |
| 53 | + # logic appears to be buggy, because it sometimes removes dependencies from |
| 54 | + # src/node_modules but fails to add them to the top-level node_modules. Even |
| 55 | + # if npm correctly hoists the dependencies, the hoisting seems to confuse |
| 56 | + # tools such as `npm outdated`, `npm update`, and some ESLint rules. |
| 57 | + - name: Install all dependencies and symlink for ep_etherpad-lite |
| 58 | + run: src/bin/installDeps.sh |
| 59 | + |
| 60 | + - name: Run the backend tests |
| 61 | + run: cd src && npm test |
| 62 | + |
| 63 | + - name: Git fetch |
| 64 | + run: git fetch |
| 65 | + |
| 66 | + - name: Checkout this branch over master |
| 67 | + run: git checkout "${GITHUB_SHA}" |
| 68 | + |
| 69 | + - name: Install all dependencies and symlink for ep_etherpad-lite |
| 70 | + run: src/bin/installDeps.sh |
| 71 | + |
| 72 | + - name: Run the backend tests |
| 73 | + run: cd src && npm test |
| 74 | + |
| 75 | + - name: Install Cypress |
| 76 | + run: npm install cypress -g |
| 77 | + |
| 78 | + - name: Run Etherpad & Test Frontend |
| 79 | + run: | |
| 80 | + node src/node/server.js & |
| 81 | + curl --connect-timeout 10 --max-time 20 --retry 5 --retry-delay 10 --retry-max-time 60 --retry-connrefused http://127.0.0.1:9001/p/test |
| 82 | + cd src/tests/frontend |
| 83 | + cypress run --spec cypress/integration/test.js --config-file cypress/cypress.json |
0 commit comments