Skip to content

Commit 98343c9

Browse files
committed
Enable GitHub Actions for CI
Signed-off-by: Nahum Shalman <nshalman@equinix.com>
1 parent 7ce0d3a commit 98343c9

2 files changed

Lines changed: 37 additions & 2 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: For each commit and PR
2+
on:
3+
push:
4+
pull_request:
5+
6+
jobs:
7+
validation:
8+
runs-on: ubuntu-latest
9+
env:
10+
CGO_ENABLED: 0
11+
steps:
12+
- name: Setup Dynamic Env
13+
run: |
14+
echo "MAKEFLAGS=-j$(nproc)" | tee $GITHUB_ENV
15+
- name: Checkout code
16+
uses: actions/checkout@v2
17+
- name: Install nix
18+
uses: cachix/install-nix-action@018abf956a0a15673dae4932ae26f0f071ac0944
19+
with:
20+
nix_path: nixpkgs=channel:nixpkgs-unstable
21+
- name: lint
22+
run: nix-shell --run "make --keep-going verify"
23+
- name: test
24+
run: nix-shell --run "make test"
25+
- name: go test coverage
26+
run: nix-shell --run "make coverage"
27+
- name: upload codecov
28+
run: bash <(curl -s https://codecov.io/bash)
29+
- name: run example
30+
if: ${{ startsWith(github.ref, 'refs/heads/master') }}
31+
env:
32+
PACKET_ENV: "ci"
33+
PACKET_VERSION: "${GITHUB_SHA}"
34+
ROLLBAR_TOKEN: ${{secrets.ROLLBAR_TOKEN}}
35+
run: nix-shell --run 'make run'

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ all: example ## Build example binary
77
-include rules.mk
88

99
test: ## Run tests
10-
go test -v ./...
10+
go test ./...
1111

1212
coverage: ## Generate coverage report
13-
CGO_ENABLED=1 go test -v -race -coverprofile=coverage.txt -covermode=atomic ./...
13+
CGO_ENABLED=1 go test -race -coverprofile=coverage.txt -covermode=atomic ./...
1414

1515
# Enable this later
1616
#verify: gofumpt prettier lint # # Verify code style, is lint free, freshness ...

0 commit comments

Comments
 (0)