Skip to content

Commit 6788fa2

Browse files
committed
start using actions with a dummy module
This way, we can actually show how it works in practice.
1 parent 9b5a692 commit 6788fa2

File tree

5 files changed

+50
-1
lines changed

5 files changed

+50
-1
lines changed

.github/workflows/test.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
on: [push, pull_request]
2+
name: Test
3+
jobs:
4+
test:
5+
strategy:
6+
matrix:
7+
go-version: [1.12.9, 1.13]
8+
platform: [ubuntu-latest, macos-latest, windows-latest]
9+
runs-on: ${{ matrix.platform }}
10+
steps:
11+
- name: Install Go
12+
uses: actions/setup-go@v1
13+
with:
14+
go-version: ${{ matrix.go-version }}
15+
- name: Checkout code
16+
uses: actions/checkout@v1
17+
- name: Test
18+
run: go test ./...

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
[GitHub Actions](https://github.com/features/actions) includes CI/CD for free
44
for Open Source repositories. This document contains information on making it
5-
work well for [Go](https://github.com/features/actions).
5+
work well for [Go](https://github.com/features/actions). See them [in
6+
action](https://github.com/mvdan/github-actions-golang/actions):
67

78
```
89
$ cat .github/workflows/test.yml

actions.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Copyright (c) 2019, Daniel Martí <mvdan@mvdan.cc>
2+
// See LICENSE for licensing information
3+
4+
package actions
5+
6+
import (
7+
"fmt"
8+
"runtime"
9+
)
10+
11+
func Demo() {
12+
fmt.Printf("Go version: %s\n", runtime.Version())
13+
fmt.Printf("GOOS: %s\n", runtime.GOOS)
14+
fmt.Printf("GOARCH: %s\n", runtime.GOARCH)
15+
}

actions_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Copyright (c) 2019, Daniel Martí <mvdan@mvdan.cc>
2+
// See LICENSE for licensing information
3+
4+
package actions
5+
6+
import (
7+
"testing"
8+
)
9+
10+
func TestDemo(t *testing.T) {
11+
Demo()
12+
}

go.mod

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module dummy.module/actions
2+
3+
go 1.13

0 commit comments

Comments
 (0)