From 0fe09af7b5962145e7ca0a23a5803652beec28d8 Mon Sep 17 00:00:00 2001 From: david Date: Mon, 10 Mar 2025 13:18:35 +0100 Subject: [PATCH] ai --- action.yml | 76 +++++++++++++++++++++--------------------------------- 1 file changed, 30 insertions(+), 46 deletions(-) diff --git a/action.yml b/action.yml index 4614a37..2ff4904 100644 --- a/action.yml +++ b/action.yml @@ -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 \ No newline at end of file