-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (70 loc) · 2.66 KB
/
github-runner-utils-build.yaml
File metadata and controls
84 lines (70 loc) · 2.66 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
name: github-runner-utils-build
on:
push:
paths-ignore:
- '**.md'
defaults:
run:
shell: bash
jobs:
build-github-runner-utils:
name: Build github-runner-utils
runs-on: ubuntu-latest
env:
S3Location: TODO/github-runner-utils
GOCACHE: /tmp/go/cache
GoVersion: 1.20.4
Region: ap-southeast-2
steps:
- uses: actions/checkout@v6
- name: Build Info
run: |
echo "github.ref: ${{ github.ref }}"
echo "pwd: $PWD"
- name: Run yamllint
run: yamllint -c ./.github/linters/.yaml-lint.yaml .github -f parsable
- name: Install Go ${{ env.GoVersion }} within build folder
run: |
GO_FILENAME=go${{ env.GoVersion }}.linux-amd64.tar.gz
DOWNLOAD_LINK="https://go.dev/dl/${GO_FILENAME}"
wget -q ${DOWNLOAD_LINK} -O ${GO_FILENAME}
tar -xzf ${GO_FILENAME}
rm ${GO_FILENAME}*
echo "$PWD/go/bin" >> $GITHUB_PATH
echo "GOPATH=$PWD/go" >> $GITHUB_ENV
- name: Check Go version
run: |
echo "INFO: Check Go version: $(go version)"
- name: Build github-runner-utils binary
run: |
go build
./github-runner-utils -help
- name: Check github-runner-utils version
run: |
echo "INFO: Check github-runner-utils version: $(./github-runner-utils -version)"
- name: Run github-runner-utils unit tests
run: |
CGO_ENABLED=0 go test -v
# - uses: aws-actions/configure-aws-credentials@v1-node16
# with:
# aws-region: ${{ env.Region }}
# role-to-assume: arn:aws:iam::123456789012:role/github-ci-deploy
# role-skip-session-tagging: true
# role-duration-seconds: 900
# - if: ${{ github.ref == 'refs/heads/master' }}
# name: Deploy master binary to S3 bucket
# run: |
# BINARY_VERSION=$(github-runner-utils -version)
# echo "INFO: Upload version: ${BINARY_VERSION}"
# aws s3 cp github-runner-utils s3://${{ env.S3Location }}/${BINARY_VERSION}/github-runner-utils
# aws s3 cp github-runner-utils s3://${{ env.S3Location }}/latest/github-runner-utils
# - if: ${{ github.ref != 'refs/heads/master' }}
# name: Deploy branch binary to S3 bucket
# run: |
# aws s3 cp github-runner-utils s3://${{ env.S3Location }}/dev/github-runner-utils
# - name: Clean-up Go installation within build folder
# if: always()
# run: |
# GO_FILENAME=go${{ env.GoVersion }}.linux-amd64.tar.gz
# [[ ! -f "$GO_FILENAME" ]] || rm ${GO_FILENAME}*
# [[ ! -d "$PWD/go" ]] || rm -rf ${PWD}/go