Skip to content

Commit

Permalink
v1.3.3 (#27)
Browse files Browse the repository at this point in the history
* updated npm packages

* who uses yarn anymore?

* a readme note about ${GITHUB_ACTION}_vmLabel

* 12.3.1 template for tests

* readme version bump
  • Loading branch information
NorseGaud authored Apr 29, 2022
1 parent 7e77542 commit 721f3b4
Show file tree
Hide file tree
Showing 7 changed files with 5,984 additions and 8,299 deletions.
34 changes: 17 additions & 17 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ jobs:
id: normal-command-failure
uses: ./
with:
anka-vm-template-name: "12.2.0"
anka-vm-template-name: "12.3.1"
anka-vm-tag-name: "vanilla"
anka-run-options: "-n"
vm-commands: "java -version || if [ \\$? -gt 0 ]; then echo failed; else exit 20; fi"
- name: multi-line commands failure
id: multi-line-commands-failure
uses: ./
with:
anka-vm-template-name: "12.2.0"
anka-vm-template-name: "12.3.1"
anka-vm-tag-name: "vanilla"
anka-run-options: "-n"
vm-commands: |
Expand All @@ -41,7 +41,7 @@ jobs:
uses: ./
with:
anka-registry-pull-options: "-s" # Needed to remove other cached tags and cause openjdk pull to take a while so we can test the Lock file
anka-vm-template-name: "12.2.0"
anka-vm-template-name: "12.3.1"
anka-vm-tag-name: "vanilla"
anka-run-options: "-n"

Expand All @@ -63,8 +63,8 @@ jobs:
id: pull-test-prep-2
uses: ./
with:
host-pre-commands: "env; anka delete --yes 12.2.0 || true; anka delete --yes 12.2.0-openjdk-1.8.0_292 || true"
anka-vm-template-name: "12.2.0"
host-pre-commands: "env; anka delete --yes 12.3.1 || true; anka delete --yes 12.3.1-openjdk-1.8.0_292 || true"
anka-vm-template-name: "12.3.1"
anka-vm-tag-name: "vanilla"
vm-commands: ""

Expand All @@ -85,7 +85,7 @@ jobs:
id: basic
uses: ./
with:
anka-vm-template-name: "12.2.0"
anka-vm-template-name: "12.3.1"
anka-vm-tag-name: "vanilla+port-forward-22+brew-git"
host-post-commands: "env"
vm-commands: |
Expand Down Expand Up @@ -123,7 +123,7 @@ jobs:
id: chained-redirect
uses: ./
with:
anka-vm-template-name: "12.2.0"
anka-vm-template-name: "12.3.1"
vm-commands: "hostname && echo \"test1\" && echo \"Test2\" > /tmp/test && cat /tmp/test"

- name: Check for output (testing anything execute.test.js doesn't)
Expand All @@ -140,7 +140,7 @@ jobs:
uses: ./
with:
anka-run-options: "--wait-network --wait-time"
anka-vm-template-name: "12.2.0"
anka-vm-template-name: "12.3.1"
anka-vm-tag-name: "vanilla"
vm-commands: "hostname && ./test.bash 1 2 3 4"
anka-cp-host-paths: |
Expand All @@ -151,7 +151,7 @@ jobs:
SCRIPT_AND_ARGS_ANKA_CP_STD='${{ steps.script-and-args-anka-cp.outputs.std }}'
printf "\n=======================\nscript-and-args-anka-cp stdout\n========================\n$SCRIPT_AND_ARGS_ANKA_CP_STD"
[[ ! -z "$(echo \\"$SCRIPT_AND_ARGS_ANKA_CP_STD\\" | head -n 1)" ]] || exit 32
[[ ! -z "$(echo \\"$SCRIPT_AND_ARGS_ANKA_CP_STD\\" | grep '| 12.2.0 (vanilla)')" ]] || exit 33
[[ ! -z "$(echo \\"$SCRIPT_AND_ARGS_ANKA_CP_STD\\" | grep '| 12.3.1 (vanilla)')" ]] || exit 33
true
Expand All @@ -160,7 +160,7 @@ jobs:
id: inputs-testing
uses: ./
with:
anka-vm-template-name: "12.2.0"
anka-vm-template-name: "12.3.1"
anka-vm-tag-name: "DOESNOTEXIST"
skip-registry-pull: true
anka-custom-vm-label: "custom-label-${GITHUB_RUN_NUMBER}"
Expand Down Expand Up @@ -205,7 +205,7 @@ jobs:
id: anka-cp-1
uses: ./
with:
anka-vm-template-name: "12.2.0"
anka-vm-template-name: "12.3.1"
anka-vm-tag-name: vanilla
anka-custom-vm-label: "custom-label-${GITHUB_RUN_NUMBER}"
vm-commands: |
Expand Down Expand Up @@ -240,7 +240,7 @@ jobs:
id: anka-cp-custom-destination
uses: ./
with:
anka-vm-template-name: "12.2.0"
anka-vm-template-name: "12.3.1"
anka-vm-tag-name: vanilla
vm-commands: |
ls -alht ./test123/
Expand All @@ -266,7 +266,7 @@ jobs:
run: |
ANKA_CP_CUSTOM_DESTINATION_STD='${{ steps.anka-cp-custom-destination.outputs.std }}'
printf "\n=======================\nanka-cp-custom-destination stdout\n========================\n$ANKA_CP_CUSTOM_DESTINATION_STD"
[[ ! -z "$(echo \\"$ANKA_CP_CUSTOM_DESTINATION_STD\\" | head -n 1)" ]] || exit 70
[[ ! -z "$(echo \\"$ANKA_CP_CUSTOM_DESTINATION_STD\\" | head -n 1)" ]] || exit 80
true
Expand All @@ -275,7 +275,7 @@ jobs:
id: artifacts-anka-cp-1
uses: ./
with:
anka-vm-template-name: "12.2.0"
anka-vm-template-name: "12.3.1"
anka-vm-tag-name: vanilla
anka-custom-vm-label: "custom-label-${GITHUB_RUN_NUMBER}"
vm-commands: |
Expand Down Expand Up @@ -313,12 +313,12 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: sleep
run: "sleep 20"
run: "sleep 10"
- name: pull test 2
id: pull-test-2
uses: ./
with:
anka-vm-template-name: "12.2.0"
anka-vm-template-name: "12.3.1"
anka-vm-tag-name: "vanilla+port-forward-22"
vm-commands: |
env
Expand All @@ -333,6 +333,6 @@ jobs:
PULL_TEST_STD='${{ steps.pull-test-2.outputs.std }}'
printf "\n=======================\npull test std\n========================\n${{ steps.pull-test-2.outputs.std }}"
[[ ! -z "$(echo \\"$PULL_TEST_STD\\" | head -n 1)" ]] || exit 100
[[ ! -z "$(echo \\"$PULL_TEST_STD\\" | grep 'Lock file /tmp/registry-pull-lock-12.2.0 found')" ]] || exit 101
[[ ! -z "$(echo \\"$PULL_TEST_STD\\" | grep 'Lock file /tmp/registry-pull-lock-12.3.1 found')" ]] || exit 101
true
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- uses: actions/checkout@v2
- name: build
id: build
uses: veertuinc/anka-vm-github-action@v1.3.2
uses: veertuinc/anka-vm-github-action@v1.3.3
with:
anka-vm-template-name: "11.4"
anka-vm-tag-name: "vanilla+port-forward-22+brew-git"
Expand Down Expand Up @@ -86,7 +86,7 @@ These are defined under the `with:` mapping key inside of your workflow yaml.
#### `anka-custom-vm-label` (string) (optional)
- **Label for the cloned VM that will execute your code**
- Defaults to `github-actions-${GITHUB_REPOSITORY}-${GITHUB_RUN_NUMBER}-${GITHUB_JOB}-${GITHUB_ACTION}`
- Your custom label will have a random number added to the end of it to prevent collisions when two VMs are running on the same node with the same label
- Your custom label will have a random number added to the end of it to prevent collisions when two VMs are running on the same node with the same label. You can target `${GITHUB_ACTION'}_vmLabel` in your `host-post-commands` to target the specific VM.
#### `host-pre-commands` (string) (optional)
- **Commands you wish to run outside on the node (host) BEFORE preparation of and execution inside the VM**
- You need to escape double quotes `\"`
Expand Down Expand Up @@ -188,7 +188,7 @@ There are two types of tests we perform:
1. Unit tests (testing functions)

```bash
yarn test
npm run test
```

2. Functional testing using a workflow yaml (not in this repo)
Expand All @@ -200,6 +200,8 @@ npm run package
```

### TO-DO

- Dynamically generate tests.yml for template version to update without having to manually do it in multiple places.
- yaml lists: https://github.com/actions/toolkit/issues/184
- Figure out how to handle agent lost situations (steps just run indefinitely)
- Support multiple artifacts and files for those artifacts
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3.2
1.3.3
3 changes: 1 addition & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ const lockFileLocation = core.getInput('lock-file-location');
async function run() {
try {
const ankaVmTagName = core.getInput('anka-vm-tag-name');
const ankaVMLabel = await helpers.getVMLabel(ankaCustomVMLabel)

const ankaVMLabel = await helpers.getVMLabel(ankaCustomVMLabel);
const ankaVmCommands = core.getInput('vm-commands');
const hostPreCommands = core.getInput('host-pre-commands');
const hostPostCommands = core.getInput('host-post-commands');
Expand Down
Loading

0 comments on commit 721f3b4

Please sign in to comment.