Github Actions Improvements #85
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
| # This workflow will be triggered if there will be changes to samples | |
| # or their dependencies (events, serialization, tests). | |
| name: Java CI samples | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [ main ] | |
| paths: | |
| - 'samples/**' | |
| - 'aws-lambda-java-events/**' | |
| - 'aws-lambda-java-serialization/**' | |
| - 'aws-lambda-java-tests/**' | |
| pull_request: | |
| branches: [ '*' ] | |
| paths: | |
| - 'samples/**' | |
| - 'aws-lambda-java-events/**' | |
| - 'aws-lambda-java-serialization/**' | |
| - 'aws-lambda-java-tests/**' | |
| - '.github/workflows/samples.yml' | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up JDK 1.8 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 8 | |
| distribution: corretto | |
| cache: maven | |
| # Install dependencies | |
| - name: Install events with Maven | |
| run: mvn -B install --file aws-lambda-java-events/pom.xml | |
| - name: Install serialization with Maven | |
| run: mvn -B install --file aws-lambda-java-serialization/pom.xml | |
| - name: Install tests with Maven | |
| run: mvn -B install --file aws-lambda-java-tests/pom.xml | |
| # Install samples | |
| - name: Install Kinesis Firehose Sample with Maven | |
| run: mvn -B install --file samples/kinesis-firehose-event-handler/pom.xml | |
| custom-serialization: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| # Set up both Java 8 and 21 | |
| - name: Set up Java 8 and 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: | | |
| 8 | |
| 21 | |
| distribution: corretto | |
| cache: maven | |
| # Install events module using Java 8 | |
| - name: Install events with Maven | |
| run: | | |
| export JAVA_HOME=$JAVA_HOME_8_X64 | |
| mvn -B clean install \ | |
| -Dmaven.compiler.source=1.8 \ | |
| -Dmaven.compiler.target=1.8 \ | |
| --file aws-lambda-java-events/pom.xml | |
| # Build custom-serialization samples | |
| - name: install sam | |
| uses: aws-actions/setup-sam@v2 | |
| - name: test fastJson | |
| run: cd samples/custom-serialization/fastJson && sam build && sam local invoke -e events/event.json | grep 200 | |
| - name: test gson | |
| run: cd samples/custom-serialization/gson && sam build && sam local invoke -e events/event.json | grep 200 | |
| - name: test jackson-jr | |
| run: cd samples/custom-serialization/jackson-jr && sam build && sam local invoke -e events/event.json | grep 200 | |
| - name: test moshi | |
| run: cd samples/custom-serialization/moshi && sam build && sam local invoke -e events/event.json | grep 200 | |
| - name: test request-stream-handler | |
| run: cd samples/custom-serialization/request-stream-handler && sam build && sam local invoke -e events/event.json | grep 200 |