Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Commit

Permalink
build(project): 'build' and 'test' on GH Actions (#2)
Browse files Browse the repository at this point in the history
also, include dependabot

Signed-off-by: Xavier Coulon <xcoulon@redhat.com>
  • Loading branch information
xcoulon authored Sep 2, 2024
1 parent 81d83bd commit 5899f89
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 4 deletions.
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Set update schedule for GitHub Actions
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every day
interval: "daily"
42 changes: 42 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: ci-build
on:
push:
branches:
- master
tags-ignore:
- '*.*'

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest ]
name: Test with coverage

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: Cache dependencies
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles ('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Build
run: |
make build
- name: Test
run: |
make test
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bin
.vscode
13 changes: 9 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,14 @@ endif
BUILD_TIME = `date -u '+%Y-%m-%dT%H:%M:%SZ'`


.PHONY: install
## build the binary and copy into $(GOPATH)/bin
install:
.PHONY: build
## build the binary and copy into ./bin
build:
@go build \
-ldflags "-X github.com/codeready-toolchain/sandbox-argocd/cmd.Commit=${GIT_COMMIT_ID_SHORT} -X github.com/codeready-toolchain/sandbox-argocd/cmd.BuildTime=${BUILD_TIME}" \
-o ${GOPATH}/bin/sandbox-argocd main.go
-o bin/sandbox-argocd main.go

.PHONY: install
## build the binary and copy into $(GOPATH)/bin
install: build
@mv bin/sandbox-argocd ${GOPATH}/bin/sandbox-argocd

0 comments on commit 5899f89

Please sign in to comment.