name: Install nim description: Install the given nim version inputs: nimVersion: description: A nim version string like 2.2.2 or 2.0.8 required: true os: description: An OS string like "linux" or "windows" required: true runs: using: "composite" steps: - name: Set environment variables run: | set -x echo "nimPath=nim-${{ inputs.nimVersion }}-${{ inputs.os }}_x64.tar.xz" >> $GITHUB_ENV echo $GITHUB_ENV - name: Set environment variables 2 run: | set -x echo "nimUrl=https://nim-lang.org/download/${{ env.nimPath }}" >> $GITHUB_ENV echo $GITHUB_ENV - name: cache restore id: cachestep1 uses: actions/cache@v4 with: path: ${{ env.nimPath }} key: ${{ env.nimPath }} - name: cache hit run: | set -x if [ ! ${{ steps.cachestep1.outputs.cache-hit }} ]; then echo "Download nim tarball" wget ${{ env.nimUrl }} fi - name: cache save uses: actions/cache@v4 with: path: ${{ env.nimPath }} key: ${{ env.nimPath }} - run: mv ${{ env.nimPath }} /opt/${{ env.nimPath }} - run: cd /opt ; tar xvf ${{ env.nimPath }} - run: cd /opt ; ln -s `pwd`/nim-${{ inputs.nimVersion }}/bin/* /usr/bin/ - run: gcc --version - run: nim --version - run: nimble --version