Skip to content

Commit

Permalink
Merge pull request #10 from asecurityteam/github-actions
Browse files Browse the repository at this point in the history
GitHub Actions
  • Loading branch information
ensary authored Mar 27, 2024
2 parents 6cf8a22 + 503d570 commit ddb719d
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 173 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/golang.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
on: [push]

jobs:
golang:
runs-on: ubuntu-latest # we execute everything except make in docker anyway
name: GoLang Basics
steps:
- name: Checkout
uses: actions/checkout@v4
- name: FS Permissions
# workaround for permissions with contaner attempting to create directories
run: chmod 777 -R "$(pwd)"
- name: Dep
run: make dep
- name: Lint
run: make lint
- name: Unit Tests
run: make test
- name: Integration Tests
run: make integration
- name: Test Coverage
run: make coverage
- name: Upload Coverage
uses: codecov/codecov-action@v4
with:
files: .coverage/combined.cover.out
token: ${{ secrets.CODECOV_TOKEN }}
138 changes: 0 additions & 138 deletions .golangci.yaml

This file was deleted.

15 changes: 0 additions & 15 deletions .travis.yml

This file was deleted.

29 changes: 9 additions & 20 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,35 +1,24 @@
TAG := $(shell git rev-parse --short HEAD)
DIR := $(shell pwd -L)

# SDCLI
SDCLI_VERSION=v1.5
SDCLI=docker run --rm -v "$(DIR):$(DIR)" -w "$(DIR)" asecurityteam/sdcli:$(SDCLI_VERSION)

dep:
docker run -ti \
--mount src="$(DIR)",target="$(DIR)",type="bind" \
-w "$(DIR)" \
asecurityteam/sdcli:v1 go dep
$(SDCLI) go dep

lint:
docker run -ti \
--mount src="$(DIR)",target="$(DIR)",type="bind" \
-w "$(DIR)" \
asecurityteam/sdcli:v1 go lint
$(SDCLI) go lint

test:
docker run -ti \
--mount src="$(DIR)",target="$(DIR)",type="bind" \
-w "$(DIR)" \
asecurityteam/sdcli:v1 go test
$(SDCLI) go test

integration:
docker run -ti \
--mount src="$(DIR)",target="$(DIR)",type="bind" \
-w "$(DIR)" \
asecurityteam/sdcli:v1 go integration
$(SDCLI) go integration

coverage:
docker run -ti \
--mount src="$(DIR)",target="$(DIR)",type="bind" \
-w "$(DIR)" \
asecurityteam/sdcli:v1 go coverage
$(SDCLI) go coverage

doc: ;

Expand Down

0 comments on commit ddb719d

Please sign in to comment.