-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (48 loc) · 1.85 KB
/
test.yaml
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
name: Test
on: [push, pull_request]
jobs:
ci:
name: "Test"
strategy:
matrix:
go-version: ["1.20.x"]
node-version: [20.x]
os: ["windows-latest", "ubuntu-latest"]
runs-on: ${{matrix.os}}
env:
SHA: $(${{github.sha}}::8)
steps:
- name: Set short git commit SHA
id: vars
run: |
calculatedSha=$(git rev-parse --short ${{ github.sha }})
echo "COMMIT_SHORT_SHA=$calculatedSha" >> $GITHUB_ENV
- uses: actions/checkout@v3
- name: Check Short SHA
uses: echo '${{ env.SHA }}'
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install Node deps
run: npm i -g husky typescript
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Install dependencies
run: go get .
- name: Make Short SHA
run: echo ${GITHUB_SHA::7}
- name: Test with Go & Output
run: go test ./cmd ./cmd/init ./cmd/install -json > TestResults-${{ matrix.go-version }}-${{ matrix.os }}-${{ env.SHA }}.json
env:
test: true
FOLDCLI_MONGO_URI: ${{ secrets.FOLDCLI_MONGO_URI }}
FOLDCLI_DB_NAME: foldcli-testing
- name: Upload Go test results
uses: actions/upload-artifact@v3
if: always()
with:
name: Go-results-${{ matrix.go-version }}-${{ matrix.os }}-${{ env.SHA }}
path: TestResults-${{ matrix.go-version }}-${{ matrix.os }}-${{ env.SHA }}.json