Skip to content

Commit

Permalink
test: github action修正
Browse files Browse the repository at this point in the history
  • Loading branch information
s-nakajima committed Oct 5, 2023
1 parent f912abb commit c1f1bd1
Showing 1 changed file with 21 additions and 15 deletions.
36 changes: 21 additions & 15 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,21 @@ on:
branches:
- main
- master
- availability
pull_request:
branches:
- main
- master
- availability

name: tests

jobs:
setup:
name: setup
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- name: Slack Notification on Start
uses: rtCamp/action-slack-notify@v2.2.0
if: env.SLACK_WEBHOOK != ''
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_TESTS }}
SLACK_CHANNEL: notify-nc3-tests
Expand All @@ -28,7 +27,7 @@ jobs:
tests:
name: tests
needs: setup
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
strategy:
matrix:
php: [ '7.1', '7.2', '7.3', '7.4' ]
Expand Down Expand Up @@ -92,54 +91,61 @@ jobs:
docker-compose exec -T nc3app bash /opt/scripts/app-build.sh
- name: phpcs (PHP CodeSniffer)
if: always()
run: |
cd ${NC3_DOCKER_DIR}
docker-compose exec -T nc3app bash /opt/scripts/phpcs.sh
- name: phpmd (PHP Mess Detector)
if: always()
run: |
cd ${NC3_DOCKER_DIR}
docker-compose exec -T nc3app bash /opt/scripts/phpmd.sh
- name: phpcpd (PHP Copy/Paste Detector)
if: always()
run: |
cd ${NC3_DOCKER_DIR}
docker-compose exec -T nc3app bash /opt/scripts/phpcpd.sh
- name: gjslint (JavaScript Style Check)
if: always()
run: |
cd ${NC3_DOCKER_DIR}
docker-compose exec -T nc3app bash /opt/scripts/gjslint.sh
- name: phpdoc (PHP Documentor)
if: always()
run: |
cd ${NC3_DOCKER_DIR}
docker-compose exec -T nc3app bash /opt/scripts/phpdoc.sh
- name: phpunit (PHP UnitTest)
if: always()
run: |
cd ${NC3_DOCKER_DIR}
docker-compose exec -T nc3app bash /opt/scripts/phpunit.sh
sudo -s chmod a+w -R ${NC3_BUILD_DIR}/build
- name: push coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: ${{ matrix.php }}
run: |
cd ${NC3_BUILD_DIR}
ls -la ${NC3_BUILD_DIR}
vendors/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v
# - name: push coveralls
# env:
# COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# COVERALLS_FLAG_NAME: ${{ matrix.php }}
# run: |
# cd ${NC3_BUILD_DIR}
# ls -la ${NC3_BUILD_DIR}
# vendors/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v

- name: docker-compose remove
if: always()
run: |
cd ${NC3_DOCKER_DIR}
docker-compose rm -f
# テスト失敗時はこちらのステップが実行される
- name: Slack Notification on Failure
uses: rtCamp/action-slack-notify@v2.2.0
if: failure()
if: env.SLACK_WEBHOOK != '' && failure()
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_TESTS }}
SLACK_CHANNEL: notify-nc3-tests
Expand All @@ -148,13 +154,13 @@ jobs:

teardown:
name: teardown
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
needs: tests
steps:
# テスト成功時はこちらのステップが実行される
- name: Slack Notification on Success
if: success()
uses: rtCamp/action-slack-notify@v2.2.0
if: env.SLACK_WEBHOOK != '' && success()
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_TESTS }}
SLACK_CHANNEL: notify-nc3-tests
Expand Down

0 comments on commit c1f1bd1

Please sign in to comment.