forked from google/starlark-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitHub action for testing (google#384)
It runs all tests and confirms go.mod and go.sum are tidy, just like the Travis CI test. The action runs with Go 1.16 and 1.17 on darwin, linux, and windows.
- Loading branch information
Jay Conrod
authored
Aug 31, 2021
1 parent
f8c134c
commit d12bc23
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: Starlark Go Tests | ||
on: [push, pull_request] | ||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
go-version: [1.16.x, 1.17.x] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Run Tests | ||
shell: bash | ||
run: 'internal/test.sh' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/sh | ||
|
||
# Copyright 2021 The Bazel Authors. All rights reserved. | ||
# Use of this source code is governed by a BSD-style | ||
# license that can be found in the LICENSE file. | ||
|
||
set -eu | ||
|
||
# Confirm that go.mod and go.sum are tidy | ||
cp go.mod go.mod.orig | ||
cp go.sum go.sum.orig | ||
go mod tidy | ||
diff go.mod.orig go.mod | ||
diff go.sum.orig go.sum | ||
rm go.mod.orig go.sum.orig | ||
|
||
# Run tests | ||
go test ./... |