Skip to content

Commit

Permalink
Test outputs.
Browse files Browse the repository at this point in the history
  • Loading branch information
floitsch committed Jan 26, 2024
1 parent 81c6327 commit 64f553c
Showing 1 changed file with 59 additions and 3 deletions.
62 changes: 59 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
versions: [v2.0.0-alpha.130, latest, ""]
version: [v2.0.0-alpha.130, latest, ""]

runs-on: ${{ matrix.os }}

Expand All @@ -20,11 +20,67 @@ jobs:
uses: actions/checkout@v4

- name: Setup with version argument
if: ${{ matrix.versions != '' }}
id: setup1
if: ${{ matrix.version != '' }}
uses: ./
with:
toit-version: v2.0.0-alpha.130

- name: Setup without version argument
if: ${{ matrix.versions == '' }}
id: setup2
if: ${{ matrix.version == '' }}
uses: ./

- name: Test Toit in Path
shell: bash
run: |
toit.run --version
toit.pkg --version
- name: Test Toit in Path - native shell
run: |
toit.run --version
toit.pkg --version
- name: Test outputs
shell: bash
run: |
if [[ -z ${{ matrix.version }} ]]; then
echo "No version argument"
TOIT_URL="${{ steps.setup2.outputs.toit-url }}"
TOIT_DIR="${{ steps.setup2.outputs.toit-install-dir }}"
TOIT_SDK="${{ steps.setup2.outputs.toit-sdk-path }}"
TOIT_VERSION="${{ steps.setup2.outputs.toit-version }}"
if [[ ${{ steps.setup2.outputs.toit-version }} == "" ]]; then
echo "No version"
exit 1
fi
else
echo "With version argument"
TOIT_URL="${{ steps.setup1.outputs.toit-url }}"
TOIT_DIR="${{ steps.setup1.outputs.toit-install-dir }}"
TOIT_SDK="${{ steps.setup1.outputs.toit-sdk-path }}"
TOIT_VERSION="${{ steps.setup1.outputs.toit-version }}"
if [[ ${{ matrix.version }} != ${{ steps.setup1.outputs.toit-version }} ]]; then
echo "Version argument does not match output"
exit 1
fi
fi
# The install-dir should have a toit directory.
if [[ ! -d "$TOIT_DIR/toit" ]]; then
echo "Install dir does not exist"
exit 1
fi
# The SDK-path is the toit directory.
if [[ "$TOIT_SDK" != "$TOIT_DIR/toit" ]]; then
echo "SDK path does not match install dir"
exit 1
fi
# The URL should be a valid URL.
if [[ ! "$TOIT_URL" =~ ^https://.* ]]; then
echo "URL is not a valid URL"
exit 1
fi

0 comments on commit 64f553c

Please sign in to comment.