2022-01-04 02:54:27 +00:00
|
|
|
name: coder
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
- "release/*"
|
|
|
|
tags:
|
|
|
|
- "*"
|
|
|
|
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
- "release/*"
|
|
|
|
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
actions: none
|
|
|
|
checks: none
|
|
|
|
contents: read
|
|
|
|
deployments: none
|
|
|
|
issues: none
|
|
|
|
packages: none
|
|
|
|
pull-requests: none
|
|
|
|
repository-projects: none
|
|
|
|
security-events: none
|
|
|
|
statuses: none
|
|
|
|
|
|
|
|
jobs:
|
2022-01-05 14:48:56 +00:00
|
|
|
style-lint-golangci:
|
|
|
|
name: style/lint/golangci
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: golangci-lint
|
|
|
|
uses: golangci/golangci-lint-action@v2
|
|
|
|
with:
|
|
|
|
version: latest
|
|
|
|
|
2022-01-08 17:24:02 +00:00
|
|
|
gen:
|
|
|
|
name: "style/gen"
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Install Protoc
|
|
|
|
uses: arduino/setup-protoc@v1
|
|
|
|
with:
|
|
|
|
version: "3.6.1"
|
|
|
|
- uses: actions/setup-go@v2
|
|
|
|
with:
|
|
|
|
go-version: "^1.17"
|
|
|
|
- run:
|
|
|
|
curl -sSL
|
|
|
|
https://github.com/kyleconroy/sqlc/releases/download/v1.11.0/sqlc_1.11.0_linux_amd64.tar.gz
|
|
|
|
| sudo tar -C /usr/bin -xz sqlc
|
|
|
|
|
|
|
|
- run: go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.26
|
|
|
|
- run: go install storj.io/drpc/cmd/protoc-gen-go-drpc@v0.0.26
|
|
|
|
- run: "make --output-sync -j gen"
|
|
|
|
- run: ./scripts/check_unstaged.sh
|
|
|
|
|
2022-01-04 02:54:27 +00:00
|
|
|
style:
|
|
|
|
name: "style/${{ matrix.style }}"
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
style:
|
|
|
|
- fmt
|
|
|
|
fail-fast: false
|
|
|
|
permissions:
|
|
|
|
actions: write # for cancel-workflow-action
|
|
|
|
contents: read
|
|
|
|
steps:
|
|
|
|
- name: Cancel previous runs
|
|
|
|
if: github.event_name == 'pull_request'
|
|
|
|
uses: styfle/cancel-workflow-action@0.9.1
|
|
|
|
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
submodules: true
|
|
|
|
|
|
|
|
- name: Cache Node
|
|
|
|
id: cache-node
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
**/node_modules
|
|
|
|
.eslintcache
|
|
|
|
key: js-${{ runner.os }}-test-${{ hashFiles('**/yarn.lock') }}
|
|
|
|
|
|
|
|
- name: Install node_modules
|
|
|
|
run: yarn install
|
|
|
|
|
|
|
|
- name: "make ${{ matrix.style }}"
|
|
|
|
run: "make --output-sync -j ${{ matrix.style }}"
|
|
|
|
|
|
|
|
test-go:
|
|
|
|
name: "test/go"
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os:
|
|
|
|
- ubuntu-latest
|
|
|
|
- macos-latest
|
|
|
|
- windows-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- uses: actions/setup-go@v2
|
|
|
|
with:
|
|
|
|
go-version: "^1.17"
|
|
|
|
|
2022-01-11 15:28:41 +00:00
|
|
|
- uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
# Go mod cache, Linux build cache, Mac build cache, Windows build cache
|
|
|
|
path: |
|
|
|
|
~/go/pkg/mod
|
|
|
|
~/.cache/go-build
|
|
|
|
~/Library/Caches/go-build
|
|
|
|
%LocalAppData%\go-build
|
|
|
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-go-
|
|
|
|
|
2022-01-05 14:48:56 +00:00
|
|
|
- run: go install gotest.tools/gotestsum@latest
|
|
|
|
|
2022-01-06 21:02:05 +00:00
|
|
|
- run:
|
|
|
|
gotestsum --jsonfile="gotests.json" --packages="./..." --
|
2022-01-08 17:24:02 +00:00
|
|
|
-covermode=atomic -coverprofile="gotests.coverage" -timeout=1m
|
2022-01-05 14:48:56 +00:00
|
|
|
|
|
|
|
- uses: codecov/codecov-action@v2
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
files: ./gotests.coverage
|
|
|
|
flags: ${{ matrix.os }}
|
|
|
|
fail_ci_if_error: true
|
2022-01-04 02:54:27 +00:00
|
|
|
|
|
|
|
test-js:
|
|
|
|
name: "test/js"
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- uses: actions/setup-node@v2
|
|
|
|
with:
|
|
|
|
node-version: "14"
|
|
|
|
|
|
|
|
# Check that node is available
|
|
|
|
# TODO: Implement actual test run
|
|
|
|
- run: node --version
|