-
Notifications
You must be signed in to change notification settings - Fork 28
73 lines (65 loc) · 2.07 KB
/
ssh-runner.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: SSH on runner
on:
workflow_dispatch:
inputs:
os:
description: 'Operating System'
required: true
default: ubuntu-latest
type: choice
options:
- ubuntu-latest
- macos-latest
- windows-latest
mod:
description: 'Install Go/Node modules'
required: true
default: true
type: boolean
jobs:
setup-ssh:
name: Setup runner and open SSH endpoint
runs-on: ${{ github.event.inputs.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false
- name: Load variables from file
uses: antifree/json-to-variables@v1.0.1
with:
filename: .github/workflows/utils/variables.json
- name: Setup asdf
uses: asdf-vm/actions/setup@v1
- name: Setup go
if: runner.os != 'Windows'
run: |
asdf plugin add golang
asdf install golang
echo "go_version=$(asdf current golang | xargs | cut -d ' ' -f 2)" >> $GITHUB_ENV
- name: Cache go modules
if: github.event.inputs.mod == 'true' && runner.os != 'Windows'
uses: actions/cache@v2.1.6
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ env.go_version }}-${{ env.json_cache-versions_go }}-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-${{ env.go_version }}-${{ env.json_cache-versions_go }}-
- name: Fetch go modules
if: github.event.inputs.mod == 'true' && runner.os != 'Windows'
working-directory: .
run: go mod tidy
- name: Install emacs
shell: bash
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get install -y emacs
elif [ "$RUNNER_OS" == "Windows" ]; then
choco install emacs
else
echo "Already installed!"
fi
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
with:
limit-access-to-actor: true