|
1 | | -# setup-apama GitHub Action |
| 1 | +# GitHub Action setup-apama |
2 | 2 | This GitHub action installs Apama Community Edition on either Windows or Linux. |
3 | 3 |
|
4 | | -The environment variables are configured as if the `apama_env` script had been run/sourced. |
| 4 | +The environment variables for the workflow are configured as if the `apama_env` script had been run/sourced. |
| 5 | +This means that subsequent steps can use Apama executables such as `engine_deploy` and `apamadoc`. |
5 | 6 |
|
6 | | -This means subsequent steps can use Apama executables such as `engine_deploy` and `apamadoc`. |
7 | | -The bin directories from the JDK and Python installation included with Apama are also added to PATH. |
| 7 | +If you wish to test on both Windows and Linux, you can use a Bash shell or PowerShell to execute Apama tools on both |
| 8 | +operating systems. Since the executable for running PySys tests has different extensions on Windows/Linux, this action |
| 9 | +sets an additional `APAMA_PYSYS` environment variable containing the script name so you can run it with |
| 10 | +`$APAMA_PYSYS run <args>` in your shell script. |
8 | 11 |
|
9 | | -If you wish to test on both Windows and Linux, you can use a bash shell to execute Apama tools on both operating systems. |
10 | | -Since the executable for running PySys tests has different extensions on Windows/Linux, this action sets an additional |
11 | | -`APAMA_PYSYS` environment variable containing the script name so you can add `$APAMA_PYSYS run <params here>` to your |
12 | | -shell script. |
| 12 | +The action has only one input parameter, `apama-version`, which must be set to a valid 4-digit Apama version. |
13 | 13 |
|
14 | 14 | It is recommended to use this action with a cache to avoid downloading and running the Apama installer every time |
15 | 15 | the job executes. To do this, add the following after your checkout action and before setup-apama: |
16 | 16 |
|
| 17 | + env: |
| 18 | + # The 4-digit version to download from http://www.apamacommunity.com/downloads/ |
| 19 | + SETUP_APAMA_VERSION: 10.5.3.2 |
| 20 | + |
| 21 | + steps: |
| 22 | + - uses: actions/checkout@v2 |
| 23 | + |
17 | 24 | - name: Cached Apama installation |
18 | 25 | # always-upload is a fork of actions/cache allows cache to be saved even if some later steps (e.g. testing) fail |
19 | 26 | uses: pat-s/always-upload-cache@v2.1.3 |
| 27 | + |
| 28 | + id: cache-apama-installer |
20 | 29 | with: |
21 | | - # TODO: keep this version matching the Apama version you wish to use |
22 | | - key: apama-${{ runner.os }}-10.5.3.2 |
23 | 30 | path: ~/cached-apama-installation.tar |
| 31 | + key: apama-${{ runner.os }}-${{ env.SETUP_APAMA_VERSION }} |
| 32 | + |
| 33 | + - uses: setup-apama@v1 |
| 34 | + with: |
| 35 | + apama-version: ${{ env.SETUP_APAMA_VERSION }} |
| 36 | + |
| 37 | + - name: Run PySys tests |
| 38 | + shell: bash |
| 39 | + run: | |
| 40 | + echo APAMA_HOME is: $APAMA_HOME |
| 41 | + $APAMA_PYSYS run --mode=ALL --threads=auto --purge |
| 42 | + |
| 43 | +Note that the Linux environment usually executes quite a lot faster than the Windows one, so if you don't need |
| 44 | +multi-platform testing, use a workflow that runs only on Linux for maximum efficiency. |
| 45 | + |
| 46 | +See https://github.com/ApamaCommunity for a complete sample workflow using this action. |
0 commit comments