From 6cc2bf909ab14c80ac606980f3d58711a6f46689 Mon Sep 17 00:00:00 2001 From: Yuki Oshima <39944763+os1ma@users.noreply.github.com> Date: Fri, 6 Jan 2023 13:46:44 +0900 Subject: [PATCH] Change CI from CircleCI to GitHub Actions --- .circleci/config.yml | 46 ----------------------------------- .github/workflows/master.yaml | 43 ++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 46 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/master.yaml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 03c26e1..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,46 +0,0 @@ -version: 2 -jobs: - build: - machine: true - working_directory: ~/kotlin-spring-jooq-flyway - - environment: - JVM_OPTS: -Xmx3200m - TERM: dumb - - steps: - - checkout - - - run: sudo curl -L "https://github.com/docker/compose/releases/download/1.25.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && sudo chmod +x /usr/local/bin/docker-compose - - - restore_cache: - keys: - - v1-dependencies-{{ checksum "build.gradle.kts" }}-{{ checksum "etc/java/jooq-flyway.gradle" }} - # fallback to using the latest cache if no exact match is found - - v1-dependencies- - - - run: - command: ./bin/build_on_docker.sh - no_output_timeout: 30m - - - save_cache: - paths: - - /root/.gradle - key: v1-dependencies-{{ checksum "build.gradle.kts" }}-{{ checksum "etc/java/jooq-flyway.gradle" }} - -workflows: - version: 2 - on_commit: - jobs: - - build - cron: - jobs: - - build - triggers: - - schedule: - # UTC - cron: "0 12 * * *" - filters: - branches: - only: - - master diff --git a/.github/workflows/master.yaml b/.github/workflows/master.yaml new file mode 100644 index 0000000..b05e1fd --- /dev/null +++ b/.github/workflows/master.yaml @@ -0,0 +1,43 @@ +name: master + +on: + push: + branches: + - main + schedule: + # 日本時間で毎晩 21 時 + - cron: '0 12 * * *' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - uses: actions/cache@v2 + with: + path: ~/.gradle/caches + key: ${{ runner.os }}-${{ runner.workflow }}-gradle-${{ hashFiles('**/*.gradle') }} + restore-keys: ${{ runner.os }}-${{ runner.workflow }}-gradle + + - uses: actions/setup-java@v1 + with: + java-version: '8' + java-package: jdk + architecture: x64 + - run: ./bin/build_on_docker.sh + + - name: Archive reports + uses: actions/upload-artifact@v2 + if: ${{ always() }} + with: + name: reports + path: ./build/reports/** + + - name: Slack Notification + uses: rtCamp/action-slack-notify@v2 + if: ${{ failure() }} + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} + SLACK_COLOR: ${{ job.status }} + SLACK_MESSAGE: 'BUILD FAILURE'