This commit is contained in:
david 2025-03-10 13:18:35 +01:00
parent 6fcbade20a
commit 0fe09af7b5

View file

@ -3,58 +3,42 @@ description: Install the given nim version
inputs: inputs:
nimVersion: nimVersion:
description: a nim version string like 2.2.2 or 2.0.8 description: A nim version string like 2.2.2 or 2.0.8
required: false required: true
os: os:
description: a os string like "linux" "windows" description: An OS string like "linux" or "windows"
required: false required: true
runs: runs:
using: 'composite' using: "composite"
steps: steps:
- name: Install nim - name: Set environment variables
shell: bash run: |
run: echo ${{inputs.nimVersion}} , ${{inputs.os}} echo "nimPath=nim-${{ inputs.nimVersion }}-${{ inputs.os }}_x64.tar.xz" >> $GITHUB_ENV
echo "nimUrl=https://nim-lang.org/download/${{ env.nimPath }}" >> $GITHUB_ENV
- name: cache restore - name: cache restore
id: cachestep1 id: cachestep1
uses: https://code.forgejo.org/actions/cache/restore@v4 uses: actions/cache@v4
with: with:
path: "${{inputs.nimPath}}" path: ${{ env.nimPath }}
key: "${{inputs.nimPath}}" key: ${{ env.nimPath }}
#jobs: - name: cache hit
# main: run: |
# #runs-on: docker if [ ! ${{ steps.cachestep1.outputs.cache-hit }} ]; then
# #env: echo "Download nim tarball"
# # nimPath: "nim-${{inputs.nimVersion}}-${{inputs.os}}_x64.tar.xz" wget ${{ env.nimUrl }}
# # nimUrl: "https://nim-lang.org/download/${{env.nimPath}}" fi
# steps:
# - run: echo "OK" - name: cache save
# uses: actions/cache@v4
# ## Tries to use the cached version of the nim tar ball with:
# - name: cache restore path: ${{ env.nimPath }}
# id: cachestep1 key: ${{ steps.cachestep1.outputs.cache-key }}
# uses: https://code.forgejo.org/actions/cache/restore@v4
# with: - run: tar xvf ${{ env.nimPath }}
# path: ${{env.nimPath}} - run: ln -s `pwd`/nim-${{ inputs.nimVersion }}/bin/* /usr/bin/
# key: ${{env.nimPath}} - run: gcc --version
# - run: nim --version
# - name: cache hit - run: nimble --version
# run: |
# if [ ! ${{steps.cachestep1.outputs.cache-hit}} ]; then
# echo "Download nim tarball"
# wget ${{env.nimUrl}}
# fi
#
# - name: cache save
# uses: https://code.forgejo.org/actions/cache/save@v4
# with:
# path: ${{env.nimPath}}
# key: ${{steps.cachestep1.outputs.cache-key}}
#
# - run: tar xvf ${{env.nimPath}}
# - run: ln -s `pwd`/nim-${{inputs.nimVersion}}/bin/* /usr/bin/
# - run: gcc --version
# - run: nim --version
# - run: nimble --version