Compare commits

..

No commits in common. "master" and "v1" have entirely different histories.
master ... v1

View file

@ -3,52 +3,66 @@ 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: true required: true
os: os:
description: An OS string like "linux" or "windows" description: a os string like "linux" "windows"
required: true required: true
runs: runs:
using: "composite" env:
nimPath: "nim-${{inputs.nimVersion}}-${{inputs.os}}_x64.tar.xz"
nimUrl: "https://nim-lang.org/download/${{env.nimPath}}"
steps: 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
## Do some test steps
- uses: actions/checkout@v4
- run: echo start docker
- run: env
- run: cat /etc/apt/sources.list
- run: ls
## Tries to use the cached version of the nim tar ball
- name: cache restore - name: cache restore
id: cachestep1 id: cachestep1
uses: actions/cache@v4 uses: https://code.forgejo.org/actions/cache/restore@v4
with: with:
path: ${{ env.nimPath }} path: ${{env.nimPath}}
key: ${{ env.nimPath }} key: ${{env.nimPath}}
# - name: cache hit
# run: |
# set -x
# test "${{ steps.cachestep1.outputs.cache-hit }}" != true
- name: cache hit - name: cache hit
run: | run: |
set -x
if [ ! ${{ steps.cachestep1.outputs.cache-hit }} ]; then if [ ! ${{ steps.cachestep1.outputs.cache-hit }} ]; then
echo "Download nim tarball" echo "Download nim tarball"
wget ${{ env.nimUrl }} wget ${{env.nimUrl}}
fi fi
- name: cache save # # Download if no cache hit
uses: actions/cache@v4 # - run: wget https://nim-lang.org/download/nim-2.2.2-linux_x64.tar.xz
with:
path: ${{ env.nimPath }}
key: ${{ env.nimPath }}
- run: mv ${{ env.nimPath }} /opt/${{ env.nimPath }} - name: cache save
- run: cd /opt ; tar xvf ${{ env.nimPath }} uses: https://code.forgejo.org/actions/cache/save@v4
- run: cd /opt ; ln -s `pwd`/nim-${{ inputs.nimVersion }}/bin/* /usr/bin/ with:
path: ${{env.nimPath}}
key: ${{ steps.cachestep1.outputs.cache-primary-key }}
- run: tar xvf ${{env.nimPath}}
- run: ln -s `pwd`/nim-${{inputs.nimVersion}}/bin/* /usr/bin/
- run: gcc --version - run: gcc --version
- run: nim --version - run: nim --version
- run: nimble --version - run: nimble --version
# - uses: actions/upload-artifact@v3
# with:
# name: myBuild
# path: testRunner