-
Notifications
You must be signed in to change notification settings - Fork 6
99 lines (81 loc) · 2.58 KB
/
build-and-test.yml
File metadata and controls
99 lines (81 loc) · 2.58 KB
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: Build and Test
run-name: Build and Test ${{ github.actor }} ${{ github.event_name }}
on:
workflow_call:
inputs:
runs-on:
description: 'The runner environment for the job (e.g., ubuntu-latest, windows-latest).'
required: false
type: string
default: 'ubuntu-latest'
ref:
description: 'The Git ref to checkout.'
required: true
type: string
workflow_dispatch:
inputs:
runs-on:
description: 'The runner environment for the job (e.g., ubuntu-latest, windows-latest).'
required: false
type: string
default: 'ubuntu-latest'
ref:
description: 'The Git ref to checkout.'
required: true
type: string
permissions:
contents: read
jobs:
get-configs:
uses: ./.github/workflows/configs.yml
build-test-nodejs:
needs: [ get-configs ]
runs-on: ${{ inputs.runs-on }}
steps:
- uses: actions/checkout@v5
with:
ref: ${{ inputs.ref }}
fetch-tags: true
- name: Git Status
shell: bash
run: echo "Building from branch=$(git rev-parse --abbrev-ref HEAD), commit=$(git rev-parse HEAD), tag=$(git describe --tags --exact-match)"
- name: Setup Node.js ${{ needs.get-configs.outputs.node-version }} (${{ runner.os }})
uses: actions/setup-node@v6
with:
node-version: ${{ needs.get-configs.outputs.node-version }}
cache: 'npm'
- name: Install Dependencies
run: npm ci
- name: Build
run: npm run build
- name: Code Quality
run: npm run lint && npm run check:duplicates
- name: Test
run: npm run test
build-test-go:
needs: [ get-configs ]
runs-on: ${{ inputs.runs-on }}
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
ref: ${{ inputs.ref }}
fetch-tags: true
- name: Git Status
shell: bash
run: echo "Building from branch=$(git rev-parse --abbrev-ref HEAD), commit=$(git rev-parse HEAD), tag=$(git describe --tags --exact-match)"
- name: Setup Go ${{ needs.get-configs.outputs.go-version }} (${{ runner.os }})
uses: actions/setup-go@v6
with:
go-version: ${{ needs.get-configs.outputs.go-version }}
cache-dependency-path: cfn-init/go.sum
- name: Build
shell: bash
env:
GOPROXY: direct
run: go build -C ./cfn-init -v ./...
- name: Test
shell: bash
env:
GOPROXY: direct
run: go test -C ./cfn-init -v -cover ./...