|
1 | 1 | name: Moodle Plugin CI |
2 | | - |
3 | 2 | on: [push, pull_request] |
4 | 3 |
|
5 | 4 | jobs: |
6 | | - static: |
7 | | - runs-on: ubuntu-latest |
8 | | - |
9 | | - strategy: |
10 | | - matrix: |
11 | | - php: ['8.2'] |
12 | | - moodle-branch: ['MOODLE_404_STABLE'] |
13 | | - database: ['pgsql'] |
14 | | - |
15 | | - steps: |
16 | | - - name: Start PostgreSQL |
17 | | - run: docker run -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_HOST_AUTH_METHOD=trust -d postgres:14 |
18 | | - |
19 | | - - name: Check out repository code |
20 | | - uses: actions/checkout@v4 |
21 | | - with: |
22 | | - path: plugin |
23 | | - |
24 | | - - name: Setup PHP ${{ matrix.php }} |
25 | | - uses: shivammathur/setup-php@v2 |
26 | | - with: |
27 | | - php-version: ${{ matrix.php }} |
28 | | - ini-values: max_input_vars=5000 |
29 | | - coverage: none |
30 | | - |
31 | | - - name: Initialise moodle-plugin-ci |
32 | | - run: | |
33 | | - composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^4 |
34 | | - echo $(cd ci/bin; pwd) >> $GITHUB_PATH |
35 | | - echo $(cd ci/vendor/bin; pwd) >> $GITHUB_PATH |
36 | | - sudo locale-gen en_AU.UTF-8 |
37 | | - echo "NVM_DIR=$HOME/.nvm" >> $GITHUB_ENV |
38 | | -
|
39 | | - - name: Install moodle-plugin-ci |
40 | | - run: | |
41 | | - moodle-plugin-ci install --plugin ./plugin --db-host=127.0.0.1 --no-init |
42 | | - env: |
43 | | - DB: ${{ matrix.database }} |
44 | | - MOODLE_BRANCH: ${{ matrix.moodle-branch }} |
45 | | - |
46 | | - - name: PHP Lint |
47 | | - if: ${{ always() }} |
48 | | - run: moodle-plugin-ci phplint |
49 | | - |
50 | | - - name: PHP Mess Detector |
51 | | - if: ${{ always() }} |
52 | | - run: moodle-plugin-ci phpmd |
53 | | - |
54 | | - - name: Moodle Code Checker |
55 | | - if: ${{ always() }} |
56 | | - run: moodle-plugin-ci codechecker |
57 | | - |
58 | | - - name: Moodle PHPDoc Checker |
59 | | - if: ${{ always() }} |
60 | | - run: moodle-plugin-ci phpdoc |
61 | | - |
62 | | - - name: Validating |
63 | | - if: ${{ always() }} |
64 | | - run: moodle-plugin-ci validate |
65 | | - |
66 | | - - name: Check upgrade savepoints |
67 | | - if: ${{ always() }} |
68 | | - run: moodle-plugin-ci savepoints |
69 | | - |
70 | | - - name: Mustache Lint |
71 | | - if: ${{ always() }} |
72 | | - run: moodle-plugin-ci mustache |
73 | | - |
74 | | - - name: Grunt |
75 | | - if: ${{ always() }} |
76 | | - run: moodle-plugin-ci grunt |
77 | | - |
78 | | - test: |
79 | | - runs-on: ubuntu-latest |
80 | | - needs: static |
81 | | - |
82 | | - strategy: |
83 | | - fail-fast: false |
84 | | - matrix: |
85 | | - php: ['8.0', '8.1', '8.2'] |
86 | | - moodle-branch: ['MOODLE_401_STABLE', 'MOODLE_402_STABLE', 'MOODLE_403_STABLE', 'MOODLE_404_STABLE'] |
87 | | - database: ['mariadb', 'pgsql'] |
88 | | - exclude: |
89 | | - - php: '8.0' |
90 | | - moodle-branch: 'MOODLE_404_STABLE' |
91 | | - - php: '8.2' |
92 | | - moodle-branch: 'MOODLE_401_STABLE' |
93 | | - include: |
94 | | - - php: '7.4' |
95 | | - moodle-branch: 'MOODLE_401_STABLE' |
96 | | - database: 'pgsql' |
97 | | - - php: '7.4' |
98 | | - moodle-branch: 'MOODLE_401_STABLE' |
99 | | - database: 'mariadb' |
100 | | - |
101 | | - steps: |
102 | | - - name: Start MariaDB |
103 | | - if: matrix.database == 'mariadb' |
104 | | - run: docker run -p 3306:3306 -e MYSQL_USER=root -e MYSQL_ALLOW_EMPTY_PASSWORD=true -d mariadb:10 |
105 | | - |
106 | | - - name: Start PostgreSQL |
107 | | - if: matrix.database == 'pgsql' |
108 | | - run: docker run -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_HOST_AUTH_METHOD=trust -d postgres:14 |
109 | | - |
110 | | - - name: Check out repository code |
111 | | - uses: actions/checkout@v4 |
112 | | - with: |
113 | | - path: plugin |
114 | | - |
115 | | - - name: Setup PHP ${{ matrix.php }} |
116 | | - uses: shivammathur/setup-php@v2 |
117 | | - with: |
118 | | - php-version: ${{ matrix.php }} |
119 | | - ini-values: max_input_vars=5000 |
120 | | - coverage: none |
121 | | - |
122 | | - - name: Initialise moodle-plugin-ci |
123 | | - run: | |
124 | | - composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^3 |
125 | | - echo $(cd ci/bin; pwd) >> $GITHUB_PATH |
126 | | - echo $(cd ci/vendor/bin; pwd) >> $GITHUB_PATH |
127 | | - sudo locale-gen en_AU.UTF-8 |
128 | | - echo "NVM_DIR=$HOME/.nvm" >> $GITHUB_ENV |
129 | | -
|
130 | | - - name: Install moodle-plugin-ci |
131 | | - run: | |
132 | | - moodle-plugin-ci install --plugin ./plugin --db-host=127.0.0.1 |
133 | | - env: |
134 | | - DB: ${{ matrix.database }} |
135 | | - MOODLE_BRANCH: ${{ matrix.moodle-branch }} |
136 | | - |
137 | | - - name: PHPUnit tests |
138 | | - if: ${{ always() }} |
139 | | - run: moodle-plugin-ci phpunit |
140 | | - |
141 | | - - name: Behat features |
142 | | - if: ${{ always() }} |
143 | | - run: moodle-plugin-ci behat --profile chrome --auto-rerun 0 |
144 | | - |
145 | | - # This step allows to upload Behat faildump (screenshots) as workflow artifact, |
146 | | - # so it can be downloaded and inspected. You don't need this step if you |
147 | | - # are not running Behat test. Artifact will be retained for 7 days. |
148 | | - - name: Upload Behat Faildump |
149 | | - if: ${{ failure() && steps.behat.outcome == 'failure' }} |
150 | | - uses: actions/upload-artifact@v4 |
151 | | - with: |
152 | | - name: Behat Faildump (${{ join(matrix.*, ', ') }}) |
153 | | - path: ${{ github.workspace }}/moodledata/behat_dump |
154 | | - retention-days: 7 |
155 | | - if-no-files-found: ignore |
| 5 | + run-moodle-ci: |
| 6 | + name: "Run the Moodle CI pipeline" |
| 7 | + uses: learnweb/moodle-workflows-learnweb/.github/workflows/moodle-ci.yml@main |
0 commit comments