|  | 
|  | 1 | +# This workflow will install Python dependencies, run tests and lint with a single version of Python | 
|  | 2 | +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | 
|  | 3 | + | 
|  | 4 | +name: Build Intensive | 
|  | 5 | +on: | 
|  | 6 | +  push: | 
|  | 7 | +    branches: [ master ] | 
|  | 8 | +  pull_request_target: | 
|  | 9 | +    branches: [ master ] | 
|  | 10 | + | 
|  | 11 | +permissions: | 
|  | 12 | +  id-token: write | 
|  | 13 | +  contents: read | 
|  | 14 | + | 
|  | 15 | +jobs: | 
|  | 16 | +  build-intensive: | 
|  | 17 | +    timeout-minutes: 8 | 
|  | 18 | +    runs-on: ${{ matrix.os }} | 
|  | 19 | +    defaults: | 
|  | 20 | +      run: | 
|  | 21 | +        shell: bash | 
|  | 22 | + | 
|  | 23 | +    strategy: | 
|  | 24 | +      fail-fast: false | 
|  | 25 | +      matrix: | 
|  | 26 | +        python-version: [ "3.8", "3.9", "3.10", "3.11" ] | 
|  | 27 | +        os: [ ubuntu-latest, macOS-latest, windows-latest ] | 
|  | 28 | + | 
|  | 29 | +    steps: | 
|  | 30 | +      - name: Checkout | 
|  | 31 | +        uses: actions/checkout@v4 | 
|  | 32 | + | 
|  | 33 | +      - name: Configure AWS Credentials | 
|  | 34 | +        uses: aws-actions/configure-aws-credentials@v4 | 
|  | 35 | +        with: | 
|  | 36 | +          aws-region: us-east-1 | 
|  | 37 | +          role-to-assume: arn:aws:iam::751999266872:role/GitHubWorkflows | 
|  | 38 | +          role-session-name: myGitHubActions | 
|  | 39 | + | 
|  | 40 | +      - name: Set up JDK 8 | 
|  | 41 | +        uses: actions/setup-java@v4 | 
|  | 42 | +        with: | 
|  | 43 | +          java-version: '8' | 
|  | 44 | +          distribution: 'corretto' | 
|  | 45 | + | 
|  | 46 | +      - name: Set up Python ${{ matrix.python-version }} | 
|  | 47 | +        uses: actions/setup-python@v2 | 
|  | 48 | +        with: | 
|  | 49 | +          python-version: ${{ matrix.python-version }} | 
|  | 50 | + | 
|  | 51 | +      - name: Install Python and required pips | 
|  | 52 | +        run: | | 
|  | 53 | +          python -m pip install --upgrade pip | 
|  | 54 | +          pip install -r requirements.txt | 
|  | 55 | +          pip install -r test_requirements.txt | 
|  | 56 | +          pip install build | 
|  | 57 | +
 | 
|  | 58 | +      - name: Test with Pytest | 
|  | 59 | +        run: | | 
|  | 60 | +          python -m pytest | 
|  | 61 | +
 | 
|  | 62 | +      - name: Install .jar files | 
|  | 63 | +        run: | | 
|  | 64 | +          python -m build | 
|  | 65 | +          python setup.py download_jars | 
|  | 66 | +          python setup.py install | 
|  | 67 | +
 | 
|  | 68 | +      - name: Put words to sample stream | 
|  | 69 | +        run: | | 
|  | 70 | +          sample_kinesis_wordputter.py --stream kclpysample -w cat -w dog -w bird -w lobster -w octopus | 
|  | 71 | +
 | 
|  | 72 | +      - name: Start KCL application (windows or ubuntu) | 
|  | 73 | +        if: matrix.os  != 'macOS-latest' | 
|  | 74 | +        run: | | 
|  | 75 | +          timeout 45 $(amazon_kclpy_helper.py --print_command --java $(which java) --properties samples/sample.properties) || code=$?; if [[ $code -ne 124 && $code -ne 0 ]]; then exit $code; fi | 
|  | 76 | +
 | 
|  | 77 | +      - name: Start KCL application (macOS) | 
|  | 78 | +        if: matrix.os  == 'macOS-latest' | 
|  | 79 | +        run: | | 
|  | 80 | +          brew install coreutils | 
|  | 81 | +          gtimeout 45 $(amazon_kclpy_helper.py --print_command --java $(which java) --properties samples/sample.properties) || code=$?; if [[ $code -ne 124 && $code -ne 0 ]]; then exit $code; fi | 
0 commit comments