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:
nimVersion:
description: a nim version string like 2.2.2 or 2.0.8
required: false
description: A nim version string like 2.2.2 or 2.0.8
required: true
os:
description: a os string like "linux" "windows"
required: false
description: An OS string like "linux" or "windows"
required: true
runs:
using: 'composite'
using: "composite"
steps:
- name: Install nim
shell: bash
run: echo ${{inputs.nimVersion}} , ${{inputs.os}}
- name: Set environment variables
run: |
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
id: cachestep1
uses: https://code.forgejo.org/actions/cache/restore@v4
uses: actions/cache@v4
with:
path: "${{inputs.nimPath}}"
key: "${{inputs.nimPath}}"
path: ${{ env.nimPath }}
key: ${{ env.nimPath }}
#jobs:
# main:
# #runs-on: docker
# #env:
# # nimPath: "nim-${{inputs.nimVersion}}-${{inputs.os}}_x64.tar.xz"
# # nimUrl: "https://nim-lang.org/download/${{env.nimPath}}"
# steps:
# - run: echo "OK"
#
# ## Tries to use the cached version of the nim tar ball
# - name: cache restore
# id: cachestep1
# uses: https://code.forgejo.org/actions/cache/restore@v4
# with:
# path: ${{env.nimPath}}
# key: ${{env.nimPath}}
#
# - name: cache hit
# 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
- name: cache hit
run: |
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: ${{ 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