Use env setup and test run action #416
This file contains 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: Test extract-metadata action | |
on: | |
push: | |
pull_request: | |
branches: [main] | |
jobs: | |
test-extract-metadata: | |
name: Retrieves metadata | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Check that environment is empty | |
run: '[[ -z "$IMAGE_NAME" && -z "$COMMIT_ID" && -z "$BRANCH_NAME" ]]' | |
- name: Call action to initialize environment | |
uses: HSLdevcom/jore4-tools/github-actions/extract-metadata@extract-metadata-v1 | |
- name: Environment variables are set after action is called | |
run: '[[ -n "$IMAGE_NAME" && -n "$COMMIT_ID" && -n "$BRANCH_NAME" ]]' | |
- name: Check that IMAGE_NAME environment variable is created and is valid | |
run: '[[ "$IMAGE_NAME" == "hsldevcom/jore4-tools" ]]' | |
# (tests for BRANCH_NAME, CURRENT_DATE and COMMIT_ID are omitted for now as they might change on each run so its a little bit tricky to test those) |