ci: Add GitHub Actions workflow for CI/CD pipeline #3
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: | |
| pull_request: | |
| branches: [ master ] | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up JDK 8 | |
| uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1 | |
| with: | |
| java-version: '8' | |
| distribution: 'corretto' | |
| - name: Install Ant | |
| run: sudo apt-get update && sudo apt-get install -y ant | |
| - name: Install memcached | |
| run: sudo apt-get install -y memcached | |
| - name: Stop system memcached | |
| run: sudo systemctl stop memcached || true | |
| - name: Build | |
| run: ant compile | |
| - name: Run unit tests | |
| run: ant test | |
| - name: Upload unit test reports | |
| if: always() | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: unit-test-reports | |
| path: build/junit/ | |
| - name: Run Static integration tests | |
| run: ant it -Dclient.mode=Static -Dserver.bin=/usr/bin/memcached | |
| - name: Upload integration test reports | |
| if: always() | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: integration-test-reports | |
| path: build/junit/ |