wip on action
This commit is contained in:
commit
85212a2005
1 changed files with 71 additions and 0 deletions
71
action.yml
Normal file
71
action.yml
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
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: a os string like "linux" "windows"
|
||||
required: true
|
||||
|
||||
runs:
|
||||
env:
|
||||
nimPath: "nim-${{inputs.nimVersion}}-${{inputs.os}}_x64.tar.xz"
|
||||
nimUrl: "https://nim-lang.org/download/${{env.nimPath}}"
|
||||
|
||||
|
||||
|
||||
steps:
|
||||
|
||||
## 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
|
||||
id: cachestep1
|
||||
uses: https://code.forgejo.org/actions/cache/restore@v4
|
||||
with:
|
||||
path: ${{env.nimPath}}
|
||||
key: ${{env.nimPath}}
|
||||
|
||||
# - name: cache hit
|
||||
# run: |
|
||||
# set -x
|
||||
# test "${{ steps.cachestep1.outputs.cache-hit }}" != true
|
||||
|
||||
- name: cache hit
|
||||
run: |
|
||||
if [ ! ${{ steps.cachestep1.outputs.cache-hit }} ]; then
|
||||
echo "Download nim tarball"
|
||||
wget ${{env.nimUrl}}
|
||||
fi
|
||||
|
||||
# # Download if no cache hit
|
||||
# - run: wget https://nim-lang.org/download/nim-2.2.2-linux_x64.tar.xz
|
||||
|
||||
- name: cache save
|
||||
uses: https://code.forgejo.org/actions/cache/save@v4
|
||||
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: nim --version
|
||||
- run: nimble --version
|
||||
- run: nimble install
|
||||
- run: nimble test
|
||||
- run: nimble tests
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: myBuild
|
||||
path: testRunner
|
||||
|
||||
Loading…
Reference in a new issue