Enable gradle caching #131
Workflow file for this run
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: Develop | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| build: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@v4.2.2 | |
| - name: Setup JDK | |
| uses: actions/setup-java@v4.6.0 | |
| with: | |
| distribution: 'adopt' | |
| java-version: 17 | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4.2.2 | |
| - name: Build | |
| run: ./gradlew build | |
| - name: Upload build | |
| uses: actions/upload-artifact@v4.5.0 | |
| with: | |
| name: release-artifact | |
| path: scripting-host/build/distributions/scripting-host-release.tar.gz | |
| compression-level: '0' | |
| retention-days: 7 | |
| test: | |
| runs-on: ubuntu-24.04 | |
| needs: [build] | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@v4.2.2 | |
| - name: Setup JDK | |
| uses: actions/setup-java@v4.6.0 | |
| with: | |
| distribution: 'adopt' | |
| java-version: 17 | |
| - name: Download build | |
| uses: actions/download-artifact@v4.1.8 | |
| with: | |
| name: release-artifact | |
| path: scripting-host/build/distributions/scripting-host-release.tar.gz | |
| - name: Untar release artifact | |
| run: tar --extract --gunzip --file scripting-host/build/distributions/scripting-host-release.tar.gz | |
| - name: Start nginx | |
| uses: nyurik/action-setup-nginx@v1.1 | |
| id: start_ngingx | |
| with: | |
| conf-file-text: | | |
| user runner docker; | |
| worker_processes 1; | |
| events { | |
| worker_connections 1024; | |
| } | |
| http { | |
| include mime.types; | |
| default_type application/octet-stream; | |
| sendfile on; | |
| keepalive_timeout 65; | |
| server { | |
| listen 8080; | |
| server_name localhost; | |
| location ~ ^(.*)\.kts(\?.*)?$ { | |
| root html; | |
| try_files \$1.server.kts =404; | |
| include fastcgi_params; | |
| fastcgi_pass unix:$RUNNER_TEMP/kss.sock; | |
| } | |
| } | |
| } | |
| - name: Create test config | |
| run: | | |
| echo "socket.address=$RUNNER_TEMP/kss.sock" >> kss.properties | |
| cp .github/config/logback.xml kss.logback.xml | |
| echo "logging.logback.configurationFile=kss.logback.xml" >> kss.properties | |
| - name: Run tests on nginx | |
| uses: BerniWittmann/background-server-action@v1.1.1 | |
| with: | |
| start: ./scripting-host-release/bin/kss | |
| wait-on: sleep 5 | |
| command: ./.github/scripts/test.sh "${{ steps.start_ngingx.outputs.html-dir }}" | |
| - name: Test logfile not empty | |
| run: | | |
| if [ ! -f log.txt ]; then | |
| echo "log.txt file doesn't exist" | |
| exit 1 | |
| fi | |
| if [ ! -s log.txt ]; then | |
| echo 'log.txt file is empty' | |
| exit 2 | |
| fi | |
| - name: Print nginx error logs | |
| if: ${{ failure() }} | |
| run: cat "${{ steps.start_ngingx.outputs.error-log }}" | |
| - name: Print nginx access logs | |
| if: ${{ failure() }} | |
| run: cat "${{ steps.start_ngingx.outputs.access-log }}" | |
| - name: Print kss process logs | |
| if: ${{ failure() }} | |
| run: cat log.txt |