Skip to content

Commit bb2bb48

Browse files
authored
Merge pull request #140 from nhooyr/actions
Switch to GitHub Actions for CI
2 parents 007beaf + cf82195 commit bb2bb48

File tree

6 files changed

+40
-74
lines changed

6 files changed

+40
-74
lines changed

.circleci/config.yml

-69
This file was deleted.

.github/workflows/ci.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: ci
2+
on: [push]
3+
4+
jobs:
5+
fmt:
6+
runs-on: ubuntu-latest
7+
container: docker://nhooyr/websocket-ci@sha256:549cc2716fd1ff08608b39a52af95a67bf9f490f6f31933cccd94e750985e2dc
8+
steps:
9+
- uses: actions/checkout@v1
10+
with:
11+
fetch-depth: 1
12+
- run: ./ci/fmt.sh
13+
lint:
14+
runs-on: ubuntu-latest
15+
container: docker://nhooyr/websocket-ci@sha256:549cc2716fd1ff08608b39a52af95a67bf9f490f6f31933cccd94e750985e2dc
16+
steps:
17+
- uses: actions/checkout@v1
18+
with:
19+
fetch-depth: 1
20+
- run: ./ci/lint.sh
21+
test:
22+
runs-on: ubuntu-latest
23+
container: docker://nhooyr/websocket-ci@sha256:549cc2716fd1ff08608b39a52af95a67bf9f490f6f31933cccd94e750985e2dc
24+
steps:
25+
- uses: actions/checkout@v1
26+
with:
27+
fetch-depth: 1
28+
- run: ./ci/test.sh
29+
env:
30+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/nhooyr/websocket?color=6b9ded&sort=semver)](https://github.com/nhooyr/websocket/releases)
44
[![GoDoc](https://godoc.org/nhooyr.io/websocket?status.svg)](https://godoc.org/nhooyr.io/websocket)
55
[![Codecov](https://img.shields.io/codecov/c/github/nhooyr/websocket.svg?color=65d6a4)](https://codecov.io/gh/nhooyr/websocket)
6-
[![CI](https://img.shields.io/circleci/build/github/nhooyr/websocket?label=ci&color=brightgreen)](https://github.com/nhooyr/websocket/commits/master)
6+
[![Actions Status](https://github.com/nhooyr/websocket/workflows/ci/badge.svg)](https://github.com/nhooyr/websocket/actions)
77

88
websocket is a minimal and idiomatic WebSocket library for Go.
99

ci/image/Dockerfile

+7
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,16 @@ ENV DEBIAN_FRONTEND=noninteractive
44
ENV GOPATH=/root/gopath
55
ENV GOFLAGS="-mod=readonly"
66
ENV PAGER=cat
7+
ENV CI=true
78

89
RUN apt-get update && \
910
apt-get install -y shellcheck npm && \
1011
npm install -g prettier
1112

1213
RUN git config --global color.ui always
14+
15+
# Cache go modules.
16+
COPY . /tmp/websocket
17+
RUN cd /tmp/websocket && \
18+
go mod download && \
19+
rm -rf /tmp/websocket

ci/run.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
# This script is for local testing. See .circleci for CI.
3+
# This script is for local testing. See .github/workflows/ci.yml for CI.
44

55
set -euo pipefail
66
cd "$(dirname "${0}")"

ci/test.sh

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ cd "$(git rev-parse --show-toplevel)"
66

77
argv=(
88
go run gotest.tools/gotestsum
9-
# https://circleci.com/docs/2.0/collect-test-data/
10-
"--junitfile=ci/out/websocket/testReport.xml"
119
"--format=short-verbose"
1210
--
1311
"-vet=off"
@@ -33,5 +31,5 @@ mv ci/out/coverage2.prof ci/out/coverage.prof
3331

3432
go tool cover -html=ci/out/coverage.prof -o=ci/out/coverage.html
3533
if [[ ${CI:-} ]]; then
36-
bash <(curl -s https://codecov.io/bash) -R . -f ci/out/coverage.prof
34+
bash <(curl -s https://codecov.io/bash) -Z -R . -f ci/out/coverage.prof
3735
fi

0 commit comments

Comments
 (0)