CI #279
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: "CI" | |
| on: | |
| push: | |
| branches: [ "**" ] | |
| tags-ignore: [ "**" ] | |
| schedule: | |
| - cron: "00 2 * * *" | |
| pull_request: | |
| workflow_dispatch: | |
| concurrency: | |
| cancel-in-progress: true | |
| group: ci-${{ github.event.pull_request.number || github.ref }} | |
| permissions: | |
| checks: write | |
| contents: read | |
| pull-requests: write | |
| jobs: | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| - name: Setup java | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: 25 | |
| check-latest: true | |
| distribution: "zulu" | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v5 | |
| with: | |
| add-job-summary: always | |
| cache-cleanup: on-success | |
| cache-read-only: ${{ github.ref != 'refs/heads/main' }} | |
| # automatically publishes build scans for the main branch | |
| build-scan-publish: ${{ github.ref == 'refs/heads/main' }} | |
| build-scan-terms-of-use-agree: yes | |
| build-scan-terms-of-use-url: "https://gradle.com/terms-of-service" | |
| - name: Run build | |
| run: ./gradlew build --stacktrace | |
| - name: Publish test summary | |
| if: ${{ always() }} | |
| uses: EnricoMi/publish-unit-test-result-action@v2 | |
| with: | |
| files: "**/build/test-results/test/TEST-*.xml" | |
| comment_mode: ${{ github.event_name == 'pull_request' && 'always' || 'off' }} | |
| - name: Prepare artifact jar | |
| run: cp cloudnet-rest-module/build/libs/cloudnet-rest.jar cloudnet-rest.jar | |
| - name: Upload artifact jar | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: CloudNet-Rest | |
| path: cloudnet-rest.jar |