File tree Expand file tree Collapse file tree 2 files changed +55
-5
lines changed Expand file tree Collapse file tree 2 files changed +55
-5
lines changed Original file line number Diff line number Diff line change
1
+ name : Test
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - main
7
+ pull_request :
8
+
9
+ jobs :
10
+ test :
11
+ runs-on : ${{ matrix.os }}
12
+ strategy :
13
+ matrix :
14
+ os : [ubuntu-latest, windows-latest, macos-latest]
15
+ arch : [amd64, arm64]
16
+ steps :
17
+ - name : Checkout code
18
+ uses : actions/checkout@v4
19
+
20
+ - name : Run Setup Coder Action
21
+ uses : ./action.yaml
22
+ with :
23
+ access_url : " https://coder.example.com"
24
+ coder_session_token : " dummy_token"
Original file line number Diff line number Diff line change @@ -17,15 +17,41 @@ inputs:
17
17
runs :
18
18
using : " composite"
19
19
steps :
20
- - name : Download Coder binary from access URL
21
- run : curl -fsSL $CODER_URL/bin/coder-linux-amd64 -o /usr/local/bin/coder && chmod +x /usr/local/bin/coder
20
+ - name : Download Coder binary from access URL (Windows)
21
+ if : runner.os == 'Windows'
22
+ run : |
23
+ curl -fsSL ${{ inputs.access_url }}/bin/coder-windows-amd64.exe -o $env:USERPROFILE\AppData\Local\bin\coder.exe
24
+ echo "$env:USERPROFILE\AppData\Local\bin" >> $GITHUB_PATH
25
+ shell : pwsh
26
+
27
+ - name : Download Coder binary from access URL (Linux)
28
+ if : runner.os == 'Linux'
29
+ run : |
30
+ if [[ "$RUNNER_ARCH" == "ARM64" ]]; then
31
+ ARCH="arm64"
32
+ else
33
+ ARCH="amd64"
34
+ fi
35
+ curl -fsSL ${{ inputs.access_url }}/bin/coder-linux-$ARCH -o $HOME/.local/bin/coder
36
+ chmod +x $HOME/.local/bin/coder
37
+ echo "$HOME/.local/bin" >> $GITHUB_PATH
38
+ shell : bash
39
+
40
+ - name : Download Coder binary from access URL (macOS)
41
+ if : runner.os == 'macOS'
42
+ run : |
43
+ if [[ "$RUNNER_ARCH" == "ARM64" ]]; then
44
+ ARCH="arm64"
45
+ else
46
+ ARCH="amd64"
47
+ fi
48
+ curl -fsSL ${{ inputs.access_url }}/bin/coder-darwin-$ARCH -o $HOME/.local/bin/coder
49
+ chmod +x $HOME/.local/bin/coder
22
50
shell : bash
23
- env :
24
- CODER_URL : ${{ inputs.access_url }}
25
51
26
52
- name : Login to Coder
27
- run : coder login --token $CODER_SESSION_TOKEN $CODER_URL
28
53
shell : bash
54
+ run : coder login --token $CODER_SESSION_TOKEN $CODER_URL
29
55
env :
30
56
CODER_URL : ${{ inputs.access_url }}
31
57
CODER_SESSION_TOKEN : ${{ inputs.coder_session_token }}
You can’t perform that action at this time.
0 commit comments