Workflow file for this run
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
# Simple github action workflow. | |
on: [push] | |
jobs: | |
test: | |
runs-on: windows-latest | |
steps: | |
- name: Setup constants | |
shell: bash | |
id: setup_constants | |
run: | | |
TOIT_VERSION=latest | |
# Create a temporary directory to install Toit. | |
TOIT_INSTALL_DIR=$(mktemp -d) | |
echo "TOIT_INSTALL_DIR=$TOIT_INSTALL_DIR" >> $GITHUB_OUTPUT | |
if [[ "$RUNNER_OS" = "Linux" ]]; then | |
TOIT_FILE=toit-linux.tar.gz | |
elif [[ "$RUNNER_OS" = "macOS" ]]; then | |
TOIT_FILE=toit-macos.tar.gz | |
elif [[ "$RUNNER_OS" = "Windows" ]]; then | |
TOIT_FILE=toit-windows.tar.gz | |
else | |
echo "UNSUPPORTED RUNNER: $RUNNER_OS" | |
exit 1 | |
fi | |
if [[ $TOIT_VERSION = latest ]]; then | |
echo "TOIT_URL=https://github.com/toitlang/toit/releases/latest/download/$TOIT_FILE" >> $GITHUB_OUTPUT | |
else | |
echo "TOIT_URL=https://github.com/toitlang/toit/releases/download/$TOIT_VERSION/$TOIT_FILE" >> $GITHUB_OUTPUT | |
fi | |
- name: Download Toit | |
uses: suisei-cn/[email protected] | |
with: | |
url: ${{ steps.setup_constants.outputs.TOIT_URL }} | |
target: ${{ steps.setup_constants.outputs.TOIT_INSTALL_DIR }} | |
- name: Extract Toit | |
shell: bash | |
run: | | |
ls -l ${{ steps.setup_constants.outputs.TOIT_INSTALL_DIR }} | |
cd ${{ steps.setup_constants.outputs.TOIT_INSTALL_DIR }} | |
# Extracts the tar.gz leaving a 'toit' directory containing 'bin', 'tools' and 'lib' directory. | |
tar x -zf toit-*.tar.gz | |
# strategy: | |
# matrix: | |
# os: [ubuntu-latest, macos-latest, windows-latest] | |
# runs-on: ${{ matrix.os }} | |
# steps: | |
# - id: toit_setup | |
# uses: toitlang/action-setup@7d608b722d8614f1875aff505db6efe8086b8d6c | |
# - run: | | |
# echo ${{ steps.toit_setup.outputs.toit-url }} | |
# echo ${{ steps.toit_setup.outputs.toit-install-dir }} | |
# echo ${{ steps.toit_setup.outputs.toit-version }} | |
# toit.run -s 'print "Hello world!"' | |
# toit.compile --version |