33 branches :
44 - main
55 - master
6- - availability
76 pull_request :
87 branches :
98 - main
109 - master
11- - availability
1210
1311name : tests
1412
1513jobs :
1614 setup :
1715 name : setup
18- runs-on : ubuntu-18.04
16+ runs-on : ubuntu-latest
1917 steps :
2018 - name : Slack Notification on Start
2119 uses : rtCamp/action-slack-notify@v2.2.0
20+ if : env.SLACK_WEBHOOK != ''
2221 env :
2322 SLACK_WEBHOOK : ${{ secrets.SLACK_WEBHOOK_TESTS }}
2423 SLACK_CHANNEL : notify-nc3-tests
2827 tests :
2928 name : tests
3029 needs : setup
31- runs-on : ubuntu-18.04
30+ runs-on : ubuntu-latest
3231 strategy :
3332 matrix :
3433 php : [ '7.1', '7.2', '7.3', '7.4' ]
4443 MYSQL_VERSION : ${{ matrix.mysql }}
4544 MYSQL_ROOT_PASSWORD : root
4645 MYSQL_DATABASE : cakephp_test
46+ COMPOSER_TOKEN : ${{ secrets.GITHUB_TOKEN }}
4747
4848 steps :
4949 - uses : actions/checkout@v2
@@ -91,54 +91,61 @@ jobs:
9191 docker-compose exec -T nc3app bash /opt/scripts/app-build.sh
9292
9393 - name : phpcs (PHP CodeSniffer)
94+ if : always()
9495 run : |
9596 cd ${NC3_DOCKER_DIR}
9697 docker-compose exec -T nc3app bash /opt/scripts/phpcs.sh
9798
9899 - name : phpmd (PHP Mess Detector)
100+ if : always()
99101 run : |
100102 cd ${NC3_DOCKER_DIR}
101103 docker-compose exec -T nc3app bash /opt/scripts/phpmd.sh
102104
103105 - name : phpcpd (PHP Copy/Paste Detector)
106+ if : always()
104107 run : |
105108 cd ${NC3_DOCKER_DIR}
106109 docker-compose exec -T nc3app bash /opt/scripts/phpcpd.sh
107110
108111 - name : gjslint (JavaScript Style Check)
112+ if : always()
109113 run : |
110114 cd ${NC3_DOCKER_DIR}
111115 docker-compose exec -T nc3app bash /opt/scripts/gjslint.sh
112116
113117 - name : phpdoc (PHP Documentor)
118+ if : always()
114119 run : |
115120 cd ${NC3_DOCKER_DIR}
116121 docker-compose exec -T nc3app bash /opt/scripts/phpdoc.sh
117122
118123 - name : phpunit (PHP UnitTest)
124+ if : always()
119125 run : |
120126 cd ${NC3_DOCKER_DIR}
121127 docker-compose exec -T nc3app bash /opt/scripts/phpunit.sh
122128 sudo -s chmod a+w -R ${NC3_BUILD_DIR}/build
123129
124- - name : push coveralls
125- env :
126- COVERALLS_REPO_TOKEN : ${{ secrets.GITHUB_TOKEN }}
127- COVERALLS_FLAG_NAME : ${{ matrix.php }}
128- run : |
129- cd ${NC3_BUILD_DIR}
130- ls -la ${NC3_BUILD_DIR}
131- vendors/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v
130+ # - name: push coveralls
131+ # env:
132+ # COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
133+ # COVERALLS_FLAG_NAME: ${{ matrix.php }}
134+ # run: |
135+ # cd ${NC3_BUILD_DIR}
136+ # ls -la ${NC3_BUILD_DIR}
137+ # vendors/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v
132138
133139 - name : docker-compose remove
140+ if : always()
134141 run : |
135142 cd ${NC3_DOCKER_DIR}
136143 docker-compose rm -f
137144
138145 # テスト失敗時はこちらのステップが実行される
139146 - name : Slack Notification on Failure
140147 uses : rtCamp/action-slack-notify@v2.2.0
141- if : failure()
148+ if : env.SLACK_WEBHOOK != '' && failure()
142149 env :
143150 SLACK_WEBHOOK : ${{ secrets.SLACK_WEBHOOK_TESTS }}
144151 SLACK_CHANNEL : notify-nc3-tests
@@ -147,13 +154,13 @@ jobs:
147154
148155 teardown :
149156 name : teardown
150- runs-on : ubuntu-18.04
157+ runs-on : ubuntu-latest
151158 needs : tests
152159 steps :
153160 # テスト成功時はこちらのステップが実行される
154161 - name : Slack Notification on Success
155- if : success()
156162 uses : rtCamp/action-slack-notify@v2.2.0
163+ if : env.SLACK_WEBHOOK != '' && success()
157164 env :
158165 SLACK_WEBHOOK : ${{ secrets.SLACK_WEBHOOK_TESTS }}
159166 SLACK_CHANNEL : notify-nc3-tests
0 commit comments