mirror of
https://github.com/pion/webrtc.git
synced 2025-09-26 19:21:12 +08:00
Update CI configs to v0.10.1
Update lint scripts and CI configs.
This commit is contained in:
1
.github/.gitignore
vendored
Normal file
1
.github/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.goassets
|
29
.github/fetch-scripts.sh
vendored
Executable file
29
.github/fetch-scripts.sh
vendored
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# DO NOT EDIT THIS FILE
|
||||
#
|
||||
# It is automatically copied from https://github.com/pion/.goassets repository.
|
||||
#
|
||||
# If you want to update the shared CI config, send a PR to
|
||||
# https://github.com/pion/.goassets instead of this repository.
|
||||
#
|
||||
|
||||
set -eu
|
||||
|
||||
SCRIPT_PATH="$(realpath "$(dirname "$0")")"
|
||||
GOASSETS_PATH="${SCRIPT_PATH}/.goassets"
|
||||
|
||||
GOASSETS_REF=${GOASSETS_REF:-master}
|
||||
|
||||
if [ -d "${GOASSETS_PATH}" ]; then
|
||||
if ! git -C "${GOASSETS_PATH}" diff --exit-code; then
|
||||
echo "${GOASSETS_PATH} has uncommitted changes" >&2
|
||||
exit 1
|
||||
fi
|
||||
git -C "${GOASSETS_PATH}" fetch origin
|
||||
git -C "${GOASSETS_PATH}" checkout ${GOASSETS_REF}
|
||||
git -C "${GOASSETS_PATH}" reset --hard origin/${GOASSETS_REF}
|
||||
else
|
||||
git clone -b ${GOASSETS_REF} https://github.com/pion/.goassets.git "${GOASSETS_PATH}"
|
||||
fi
|
69
.github/generate-authors.sh
vendored
69
.github/generate-authors.sh
vendored
@@ -1,69 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
#
|
||||
# DO NOT EDIT THIS FILE
|
||||
#
|
||||
# It is automatically copied from https://github.com/pion/.goassets repository.
|
||||
#
|
||||
# If you want to update the shared CI config, send a PR to
|
||||
# https://github.com/pion/.goassets instead of this repository.
|
||||
#
|
||||
|
||||
set -e
|
||||
|
||||
SCRIPT_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
|
||||
if [ -z "${AUTHORS_PATH}" ]; then
|
||||
AUTHORS_PATH="$GITHUB_WORKSPACE/AUTHORS.txt"
|
||||
fi
|
||||
|
||||
if [ -f ${SCRIPT_PATH}/.ci.conf ]; then
|
||||
. ${SCRIPT_PATH}/.ci.conf
|
||||
fi
|
||||
|
||||
#
|
||||
# DO NOT EDIT THIS
|
||||
#
|
||||
EXCLUDED_CONTRIBUTORS+=('John R. Bradley' 'renovate[bot]' 'Renovate Bot' 'Pion Bot' 'pionbot')
|
||||
# If you want to exclude a name from all repositories, send a PR to
|
||||
# https://github.com/pion/.goassets instead of this repository.
|
||||
# If you want to exclude a name only from this repository,
|
||||
# add EXCLUDED_CONTRIBUTORS=('name') to .github/.ci.conf
|
||||
|
||||
CONTRIBUTORS=()
|
||||
|
||||
shouldBeIncluded () {
|
||||
for i in "${EXCLUDED_CONTRIBUTORS[@]}"; do
|
||||
if [[ $1 =~ "$i" ]]; then
|
||||
return 1
|
||||
fi
|
||||
done
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
IFS=$'\n' #Only split on newline
|
||||
for CONTRIBUTOR in $(
|
||||
(
|
||||
git log --format='%aN <%aE>'
|
||||
git log --format='%(trailers:key=Co-authored-by)' | sed -n 's/^[^:]*:\s*//p'
|
||||
) | LC_ALL=C.UTF-8 sort -uf
|
||||
); do
|
||||
if shouldBeIncluded ${CONTRIBUTOR}; then
|
||||
CONTRIBUTORS+=("${CONTRIBUTOR}")
|
||||
fi
|
||||
done
|
||||
unset IFS
|
||||
|
||||
if [ ${#CONTRIBUTORS[@]} -ne 0 ]; then
|
||||
cat >${AUTHORS_PATH} <<-'EOH'
|
||||
# Thank you to everyone that made Pion possible. If you are interested in contributing
|
||||
# we would love to have you https://github.com/pion/webrtc/wiki/Contributing
|
||||
#
|
||||
# This file is auto generated, using git to list all individuals contributors.
|
||||
# see `.github/generate-authors.sh` for the scripting
|
||||
EOH
|
||||
for i in "${CONTRIBUTORS[@]}"; do
|
||||
echo "$i" >> ${AUTHORS_PATH}
|
||||
done
|
||||
exit 0
|
||||
fi
|
11
.github/hooks/commit-msg.sh
vendored
11
.github/hooks/commit-msg.sh
vendored
@@ -1,11 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
#
|
||||
# DO NOT EDIT THIS FILE DIRECTLY
|
||||
#
|
||||
# It is automatically copied from https://github.com/pion/.goassets repository.
|
||||
#
|
||||
|
||||
set -e
|
||||
|
||||
.github/lint-commit-message.sh $1
|
13
.github/hooks/pre-commit.sh
vendored
13
.github/hooks/pre-commit.sh
vendored
@@ -1,13 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# DO NOT EDIT THIS FILE DIRECTLY
|
||||
#
|
||||
# It is automatically copied from https://github.com/pion/.goassets repository.
|
||||
#
|
||||
|
||||
# Redirect output to stderr.
|
||||
exec 1>&2
|
||||
|
||||
.github/lint-disallowed-functions-in-library.sh
|
||||
.github/lint-no-trailing-newline-in-log-messages.sh
|
13
.github/hooks/pre-push.sh
vendored
13
.github/hooks/pre-push.sh
vendored
@@ -1,13 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# DO NOT EDIT THIS FILE DIRECTLY
|
||||
#
|
||||
# It is automatically copied from https://github.com/pion/.goassets repository.
|
||||
#
|
||||
|
||||
set -e
|
||||
|
||||
.github/generate-authors.sh
|
||||
|
||||
exit 0
|
12
.github/install-hooks.sh
vendored
12
.github/install-hooks.sh
vendored
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# DO NOT EDIT THIS FILE
|
||||
@@ -9,8 +9,10 @@
|
||||
# https://github.com/pion/.goassets instead of this repository.
|
||||
#
|
||||
|
||||
SCRIPT_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
|
||||
SCRIPT_PATH="$(realpath "$(dirname "$0")")"
|
||||
|
||||
cp "${SCRIPT_PATH}/hooks/commit-msg.sh" "${SCRIPT_PATH}/../.git/hooks/commit-msg"
|
||||
cp "${SCRIPT_PATH}/hooks/pre-commit.sh" "${SCRIPT_PATH}/../.git/hooks/pre-commit"
|
||||
cp "${SCRIPT_PATH}/hooks/pre-push.sh" "${SCRIPT_PATH}/../.git/hooks/pre-push"
|
||||
. ${SCRIPT_PATH}/fetch-scripts.sh
|
||||
|
||||
cp "${GOASSETS_PATH}/hooks/commit-msg.sh" "${SCRIPT_PATH}/../.git/hooks/commit-msg"
|
||||
cp "${GOASSETS_PATH}/hooks/pre-commit.sh" "${SCRIPT_PATH}/../.git/hooks/pre-commit"
|
||||
cp "${GOASSETS_PATH}/hooks/pre-push.sh" "${SCRIPT_PATH}/../.git/hooks/pre-push"
|
||||
|
64
.github/lint-commit-message.sh
vendored
64
.github/lint-commit-message.sh
vendored
@@ -1,64 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
#
|
||||
# DO NOT EDIT THIS FILE
|
||||
#
|
||||
# It is automatically copied from https://github.com/pion/.goassets repository.
|
||||
#
|
||||
# If you want to update the shared CI config, send a PR to
|
||||
# https://github.com/pion/.goassets instead of this repository.
|
||||
#
|
||||
|
||||
set -e
|
||||
|
||||
display_commit_message_error() {
|
||||
cat << EndOfMessage
|
||||
$1
|
||||
|
||||
-------------------------------------------------
|
||||
The preceding commit message is invalid
|
||||
it failed '$2' of the following checks
|
||||
|
||||
* Separate subject from body with a blank line
|
||||
* Limit the subject line to 50 characters
|
||||
* Capitalize the subject line
|
||||
* Do not end the subject line with a period
|
||||
* Wrap the body at 72 characters
|
||||
EndOfMessage
|
||||
|
||||
exit 1
|
||||
}
|
||||
|
||||
lint_commit_message() {
|
||||
if [[ "$(echo "$1" | awk 'NR == 2 {print $1;}' | wc -c)" -ne 1 ]]; then
|
||||
display_commit_message_error "$1" 'Separate subject from body with a blank line'
|
||||
fi
|
||||
|
||||
if [[ "$(echo "$1" | head -n1 | awk '{print length}')" -gt 50 ]]; then
|
||||
display_commit_message_error "$1" 'Limit the subject line to 50 characters'
|
||||
fi
|
||||
|
||||
if [[ ! $1 =~ ^[A-Z] ]]; then
|
||||
display_commit_message_error "$1" 'Capitalize the subject line'
|
||||
fi
|
||||
|
||||
if [[ "$(echo "$1" | awk 'NR == 1 {print substr($0,length($0),1)}')" == "." ]]; then
|
||||
display_commit_message_error "$1" 'Do not end the subject line with a period'
|
||||
fi
|
||||
|
||||
if [[ "$(echo "$1" | awk '{print length}' | sort -nr | head -1)" -gt 72 ]]; then
|
||||
display_commit_message_error "$1" 'Wrap the body at 72 characters'
|
||||
fi
|
||||
}
|
||||
|
||||
if [ "$#" -eq 1 ]; then
|
||||
if [ ! -f "$1" ]; then
|
||||
echo "$0 was passed one argument, but was not a valid file"
|
||||
exit 1
|
||||
fi
|
||||
lint_commit_message "$(sed -n '/# Please enter the commit message for your changes. Lines starting/q;p' "$1")"
|
||||
else
|
||||
for COMMIT in $(git rev-list --no-merges origin/master..); do
|
||||
lint_commit_message "$(git log --format="%B" -n 1 ${COMMIT})"
|
||||
done
|
||||
fi
|
43
.github/lint-disallowed-functions-in-library.sh
vendored
43
.github/lint-disallowed-functions-in-library.sh
vendored
@@ -1,43 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
#
|
||||
# DO NOT EDIT THIS FILE
|
||||
#
|
||||
# It is automatically copied from https://github.com/pion/.goassets repository.
|
||||
#
|
||||
# If you want to update the shared CI config, send a PR to
|
||||
# https://github.com/pion/.goassets instead of this repository.
|
||||
#
|
||||
|
||||
set -e
|
||||
|
||||
# Disallow usages of functions that cause the program to exit in the library code
|
||||
SCRIPT_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
|
||||
if [ -f ${SCRIPT_PATH}/.ci.conf ]; then
|
||||
. ${SCRIPT_PATH}/.ci.conf
|
||||
fi
|
||||
|
||||
EXCLUDE_DIRECTORIES=${DISALLOWED_FUNCTIONS_EXCLUDED_DIRECTORIES:-"examples"}
|
||||
DISALLOWED_FUNCTIONS=('os.Exit(' 'panic(' 'Fatal(' 'Fatalf(' 'Fatalln(' 'fmt.Println(' 'fmt.Printf(' 'log.Print(' 'log.Println(' 'log.Printf(' 'print(' 'println(')
|
||||
|
||||
FILES=$(
|
||||
find "${SCRIPT_PATH}/.." -name "*.go" \
|
||||
| grep -v -e '^.*_test.go$' \
|
||||
| while read FILE; do
|
||||
EXCLUDED=false
|
||||
for EXCLUDE_DIRECTORY in ${EXCLUDE_DIRECTORIES}; do
|
||||
if [[ ${FILE} == */${EXCLUDE_DIRECTORY}/* ]]; then
|
||||
EXCLUDED=true
|
||||
break
|
||||
fi
|
||||
done
|
||||
${EXCLUDED} || echo "${FILE}"
|
||||
done
|
||||
)
|
||||
|
||||
for DISALLOWED_FUNCTION in "${DISALLOWED_FUNCTIONS[@]}"; do
|
||||
if grep -e "\s${DISALLOWED_FUNCTION}" ${FILES} | grep -v -e 'nolint'; then
|
||||
echo "${DISALLOWED_FUNCTION} may only be used in example code"
|
||||
exit 1
|
||||
fi
|
||||
done
|
24
.github/lint-filename.sh
vendored
24
.github/lint-filename.sh
vendored
@@ -1,24 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
#
|
||||
# DO NOT EDIT THIS FILE
|
||||
#
|
||||
# It is automatically copied from https://github.com/pion/.goassets repository.
|
||||
#
|
||||
# If you want to update the shared CI config, send a PR to
|
||||
# https://github.com/pion/.goassets instead of this repository.
|
||||
#
|
||||
|
||||
set -e
|
||||
|
||||
SCRIPT_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
|
||||
GO_REGEX="^[a-zA-Z][a-zA-Z0-9_]*\.go$"
|
||||
|
||||
find "${SCRIPT_PATH}/.." -name "*.go" | while read FULLPATH; do
|
||||
FILENAME=$(basename -- "${FULLPATH}")
|
||||
|
||||
if ! [[ ${FILENAME} =~ ${GO_REGEX} ]]; then
|
||||
echo "${FILENAME} is not a valid filename for Go code, only alpha, numbers and underscores are supported"
|
||||
exit 1
|
||||
fi
|
||||
done
|
@@ -1,37 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
#
|
||||
# DO NOT EDIT THIS FILE
|
||||
#
|
||||
# It is automatically copied from https://github.com/pion/.goassets repository.
|
||||
#
|
||||
# If you want to update the shared CI config, send a PR to
|
||||
# https://github.com/pion/.goassets instead of this repository.
|
||||
#
|
||||
|
||||
set -e
|
||||
|
||||
# Disallow usages of functions that cause the program to exit in the library code
|
||||
SCRIPT_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
|
||||
if [ -f ${SCRIPT_PATH}/.ci.conf ]; then
|
||||
. ${SCRIPT_PATH}/.ci.conf
|
||||
fi
|
||||
|
||||
FILES=$(
|
||||
find "${SCRIPT_PATH}/.." -name "*.go" \
|
||||
| while read FILE; do
|
||||
EXCLUDED=false
|
||||
for EXCLUDE_DIRECTORY in ${EXCLUDE_DIRECTORIES}; do
|
||||
if [[ $file == */${EXCLUDE_DIRECTORY}/* ]]; then
|
||||
EXCLUDED=true
|
||||
break
|
||||
fi
|
||||
done
|
||||
${EXCLUDED} || echo "${FILE}"
|
||||
done
|
||||
)
|
||||
|
||||
if grep -E '\.(Trace|Debug|Info|Warn|Error)f?\("[^"]*\\n"\)?' ${FILES} | grep -v -e 'nolint'; then
|
||||
echo "Log format strings should have trailing new-line"
|
||||
exit 1
|
||||
fi
|
40
.github/workflows/codeql-analysis.yml
vendored
40
.github/workflows/codeql-analysis.yml
vendored
@@ -1,4 +1,15 @@
|
||||
name: "CodeQL"
|
||||
#
|
||||
# DO NOT EDIT THIS FILE
|
||||
#
|
||||
# It is automatically copied from https://github.com/pion/.goassets repository.
|
||||
# If this repository should have package specific CI config,
|
||||
# remove the repository name from .goassets/.github/workflows/assets-sync.yml.
|
||||
#
|
||||
# If you want to update the shared CI config, send a PR to
|
||||
# https://github.com/pion/.goassets instead of this repository.
|
||||
#
|
||||
|
||||
name: CodeQL
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
@@ -12,29 +23,4 @@ on:
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
actions: read
|
||||
contents: read
|
||||
security-events: write
|
||||
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v3
|
||||
|
||||
# The code in examples/ might intentionally do things like log credentials
|
||||
# in order to show how the library is used, aid in debugging etc. We
|
||||
# should ignore those for CodeQL scanning, and only focus on the package
|
||||
# itself.
|
||||
- name: Remove example code
|
||||
run: |
|
||||
rm -rf examples/
|
||||
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v2
|
||||
with:
|
||||
languages: 'go'
|
||||
|
||||
- name: CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v2
|
||||
uses: pion/.goassets/.github/workflows/codeql-analysis.reusable.yml@master
|
||||
|
66
.github/workflows/generate-authors.yml
vendored
66
.github/workflows/generate-authors.yml
vendored
@@ -9,69 +9,13 @@
|
||||
# https://github.com/pion/.goassets instead of this repository.
|
||||
#
|
||||
|
||||
name: generate-authors
|
||||
name: Generate Authors
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
checksecret:
|
||||
permissions:
|
||||
contents: none
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
is_PIONBOT_PRIVATE_KEY_set: ${{ steps.checksecret_job.outputs.is_PIONBOT_PRIVATE_KEY_set }}
|
||||
steps:
|
||||
- id: checksecret_job
|
||||
env:
|
||||
PIONBOT_PRIVATE_KEY: ${{ secrets.PIONBOT_PRIVATE_KEY }}
|
||||
run: |
|
||||
echo "is_PIONBOT_PRIVATE_KEY_set: ${{ env.PIONBOT_PRIVATE_KEY != '' }}"
|
||||
echo "::set-output name=is_PIONBOT_PRIVATE_KEY_set::${{ env.PIONBOT_PRIVATE_KEY != '' }}"
|
||||
|
||||
generate-authors:
|
||||
permissions:
|
||||
contents: write
|
||||
needs: [checksecret]
|
||||
if: needs.checksecret.outputs.is_PIONBOT_PRIVATE_KEY_set == 'true'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: ${{ github.head_ref }}
|
||||
fetch-depth: 0
|
||||
token: ${{ secrets.PIONBOT_PRIVATE_KEY }}
|
||||
|
||||
- name: Generate the authors file
|
||||
run: .github/generate-authors.sh
|
||||
|
||||
- name: Add the authors file to git
|
||||
run: git add AUTHORS.txt
|
||||
|
||||
- name: Get last commit message
|
||||
id: last-commit-message
|
||||
run: |
|
||||
COMMIT_MSG=$(git log -1 --pretty=%B)
|
||||
COMMIT_MSG="${COMMIT_MSG//'%'/'%25'}"
|
||||
COMMIT_MSG="${COMMIT_MSG//$'\n'/'%0A'}"
|
||||
COMMIT_MSG="${COMMIT_MSG//$'\r'/'%0D'}"
|
||||
echo "::set-output name=msg::$COMMIT_MSG"
|
||||
|
||||
- name: Get last commit author
|
||||
id: last-commit-author
|
||||
run: |
|
||||
echo "::set-output name=msg::$(git log -1 --pretty='%aN <%ae>')"
|
||||
|
||||
- name: Check if AUTHORS.txt file has changed
|
||||
id: git-status-output
|
||||
run: |
|
||||
echo "::set-output name=msg::$(git status -s | wc -l)"
|
||||
|
||||
- name: Commit and push
|
||||
if: ${{ steps.git-status-output.outputs.msg != '0' }}
|
||||
run: |
|
||||
git config user.email $(echo "${{ steps.last-commit-author.outputs.msg }}" | sed 's/\(.\+\) <\(\S\+\)>/\2/')
|
||||
git config user.name $(echo "${{ steps.last-commit-author.outputs.msg }}" | sed 's/\(.\+\) <\(\S\+\)>/\1/')
|
||||
git add AUTHORS.txt
|
||||
git commit --amend --no-edit
|
||||
git push --force https://github.com/${GITHUB_REPOSITORY} $(git symbolic-ref -q --short HEAD)
|
||||
generate:
|
||||
uses: pion/.goassets/.github/workflows/generate-authors.reusable.yml@master
|
||||
secrets:
|
||||
token: ${{ secrets.PIONBOT_PRIVATE_KEY }}
|
||||
|
47
.github/workflows/lint.yaml
vendored
47
.github/workflows/lint.yaml
vendored
@@ -12,50 +12,7 @@
|
||||
name: Lint
|
||||
on:
|
||||
pull_request:
|
||||
types:
|
||||
- opened
|
||||
- edited
|
||||
- synchronize
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
lint-commit-message:
|
||||
name: Metadata
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Commit Message
|
||||
run: .github/lint-commit-message.sh
|
||||
|
||||
- name: File names
|
||||
run: .github/lint-filename.sh
|
||||
|
||||
- name: Functions
|
||||
run: .github/lint-disallowed-functions-in-library.sh
|
||||
|
||||
- name: Logging messages should not have trailing newlines
|
||||
run: .github/lint-no-trailing-newline-in-log-messages.sh
|
||||
|
||||
lint-go:
|
||||
name: Go
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: read
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: golangci-lint
|
||||
uses: golangci/golangci-lint-action@v3
|
||||
with:
|
||||
version: v1.45.2
|
||||
args: $GOLANGCI_LINT_EXRA_ARGS
|
||||
lint:
|
||||
uses: pion/.goassets/.github/workflows/lint.reusable.yml@master
|
||||
|
33
.github/workflows/release.yml
vendored
33
.github/workflows/release.yml
vendored
@@ -1,4 +1,15 @@
|
||||
name: release
|
||||
#
|
||||
# DO NOT EDIT THIS FILE
|
||||
#
|
||||
# It is automatically copied from https://github.com/pion/.goassets repository.
|
||||
# If this repository should have package specific CI config,
|
||||
# remove the repository name from .goassets/.github/workflows/assets-sync.yml.
|
||||
#
|
||||
# If you want to update the shared CI config, send a PR to
|
||||
# https://github.com/pion/.goassets instead of this repository.
|
||||
#
|
||||
|
||||
name: Release
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
@@ -6,20 +17,6 @@ on:
|
||||
|
||||
jobs:
|
||||
release:
|
||||
permissions:
|
||||
contents: write
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: '1.18' # auto-update/latest-go-version
|
||||
- name: Build and release
|
||||
uses: goreleaser/goreleaser-action@v4
|
||||
with:
|
||||
version: latest
|
||||
args: release --rm-dist
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
uses: pion/.goassets/.github/workflows/release.reusable.yml@master
|
||||
with:
|
||||
go-version: '1.19' # auto-update/latest-go-version
|
||||
|
36
.github/workflows/renovate-go-mod-fix.yaml
vendored
36
.github/workflows/renovate-go-mod-fix.yaml
vendored
@@ -1,36 +0,0 @@
|
||||
#
|
||||
# DO NOT EDIT THIS FILE
|
||||
#
|
||||
# It is automatically copied from https://github.com/pion/.goassets repository.
|
||||
# If this repository should have package specific CI config,
|
||||
# remove the repository name from .goassets/.github/workflows/assets-sync.yml.
|
||||
#
|
||||
# If you want to update the shared CI config, send a PR to
|
||||
# https://github.com/pion/.goassets instead of this repository.
|
||||
#
|
||||
|
||||
name: go-mod-fix
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- renovate/*
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
go-mod-fix:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 2
|
||||
- name: fix
|
||||
uses: at-wat/go-sum-fix-action@v0
|
||||
with:
|
||||
git_user: Pion Bot
|
||||
git_email: 59523206+pionbot@users.noreply.github.com
|
||||
github_token: ${{ secrets.PIONBOT_PRIVATE_KEY }}
|
||||
commit_style: squash
|
||||
push: force
|
22
.github/workflows/renovate-go-sum-fix.yaml
vendored
Normal file
22
.github/workflows/renovate-go-sum-fix.yaml
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
#
|
||||
# DO NOT EDIT THIS FILE
|
||||
#
|
||||
# It is automatically copied from https://github.com/pion/.goassets repository.
|
||||
# If this repository should have package specific CI config,
|
||||
# remove the repository name from .goassets/.github/workflows/assets-sync.yml.
|
||||
#
|
||||
# If you want to update the shared CI config, send a PR to
|
||||
# https://github.com/pion/.goassets instead of this repository.
|
||||
#
|
||||
|
||||
name: Fix go.sum
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- renovate/*
|
||||
|
||||
jobs:
|
||||
fix:
|
||||
uses: pion/.goassets/.github/workflows/renovate-go-sum-fix.reusable.yml@master
|
||||
secrets:
|
||||
token: ${{ secrets.PIONBOT_PRIVATE_KEY }}
|
153
.github/workflows/test.yaml
vendored
153
.github/workflows/test.yaml
vendored
@@ -13,162 +13,29 @@ name: Test
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
uses: pion/.goassets/.github/workflows/test.reusable.yml@master
|
||||
strategy:
|
||||
matrix:
|
||||
go: ['1.19', '1.18'] # auto-update/supported-go-version-list
|
||||
fail-fast: false
|
||||
name: Go ${{ matrix.go }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
~/go/pkg/mod
|
||||
~/go/bin
|
||||
~/.cache
|
||||
key: ${{ runner.os }}-amd64-go-${{ hashFiles('**/go.sum') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-amd64-go-
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ${{ matrix.go }}
|
||||
|
||||
- name: Setup go-acc
|
||||
run: go install github.com/ory/go-acc@latest
|
||||
|
||||
- name: Set up gotestfmt
|
||||
uses: haveyoudebuggedit/gotestfmt-action@v2
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }} # Avoid getting rate limited
|
||||
|
||||
- name: Run test
|
||||
run: |
|
||||
TEST_BENCH_OPTION="-bench=."
|
||||
if [ -f .github/.ci.conf ]; then . .github/.ci.conf; fi
|
||||
|
||||
set -euo pipefail
|
||||
go-acc -o cover.out ./... -- \
|
||||
${TEST_BENCH_OPTION} \
|
||||
-json \
|
||||
-v -race 2>&1 | grep -v '^go: downloading' | tee /tmp/gotest.log | gotestfmt
|
||||
|
||||
- name: Upload test log
|
||||
uses: actions/upload-artifact@v3
|
||||
if: always()
|
||||
with:
|
||||
name: test-log-${{ matrix.go }}
|
||||
path: /tmp/gotest.log
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Run TEST_HOOK
|
||||
run: |
|
||||
if [ -f .github/.ci.conf ]; then . .github/.ci.conf; fi
|
||||
if [ -n "${TEST_HOOK}" ]; then ${TEST_HOOK}; fi
|
||||
|
||||
- uses: codecov/codecov-action@v3
|
||||
with:
|
||||
name: codecov-umbrella
|
||||
fail_ci_if_error: true
|
||||
flags: go
|
||||
with:
|
||||
go-version: ${{ matrix.go }}
|
||||
|
||||
test-i386:
|
||||
runs-on: ubuntu-latest
|
||||
uses: pion/.goassets/.github/workflows/test-i386.reusable.yml@master
|
||||
strategy:
|
||||
matrix:
|
||||
go: ['1.19', '1.18'] # auto-update/supported-go-version-list
|
||||
fail-fast: false
|
||||
name: Go i386 ${{ matrix.go }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
~/go/pkg/mod
|
||||
~/.cache
|
||||
key: ${{ runner.os }}-i386-go-${{ hashFiles('**/go.sum') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-i386-go-
|
||||
|
||||
- name: Run test
|
||||
run: |
|
||||
mkdir -p $HOME/go/pkg/mod $HOME/.cache
|
||||
docker run \
|
||||
-u $(id -u):$(id -g) \
|
||||
-e "GO111MODULE=on" \
|
||||
-e "CGO_ENABLED=0" \
|
||||
-v $GITHUB_WORKSPACE:/go/src/github.com/pion/$(basename $GITHUB_WORKSPACE) \
|
||||
-v $HOME/go/pkg/mod:/go/pkg/mod \
|
||||
-v $HOME/.cache:/.cache \
|
||||
-w /go/src/github.com/pion/$(basename $GITHUB_WORKSPACE) \
|
||||
i386/golang:${{matrix.go}}-alpine \
|
||||
/usr/local/go/bin/go test \
|
||||
${TEST_EXTRA_ARGS:-} \
|
||||
-v ./...
|
||||
with:
|
||||
go-version: ${{ matrix.go }}
|
||||
|
||||
test-wasm:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
name: WASM
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '16.x'
|
||||
|
||||
- uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
~/go/pkg/mod
|
||||
~/.cache
|
||||
key: ${{ runner.os }}-wasm-go-${{ hashFiles('**/go.sum') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-wasm-go-
|
||||
|
||||
- name: Download Go
|
||||
run: curl -sSfL https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz | tar -C ~ -xzf -
|
||||
env:
|
||||
GO_VERSION: '1.19' # auto-update/latest-go-version
|
||||
|
||||
- name: Set Go Root
|
||||
run: echo "GOROOT=${HOME}/go" >> $GITHUB_ENV
|
||||
|
||||
- name: Set Go Path
|
||||
run: echo "GOPATH=${HOME}/go" >> $GITHUB_ENV
|
||||
|
||||
- name: Set Go Path
|
||||
run: echo "GO_JS_WASM_EXEC=${GOROOT}/misc/wasm/go_js_wasm_exec" >> $GITHUB_ENV
|
||||
|
||||
- name: Insall NPM modules
|
||||
run: yarn install
|
||||
|
||||
- name: Run Tests
|
||||
run: |
|
||||
if [ -f .github/.ci.conf ]; then . .github/.ci.conf; fi
|
||||
GOOS=js GOARCH=wasm $GOPATH/bin/go test \
|
||||
-coverprofile=cover.out -covermode=atomic \
|
||||
-exec="${GO_JS_WASM_EXEC}" \
|
||||
-v ./...
|
||||
|
||||
- uses: codecov/codecov-action@v3
|
||||
with:
|
||||
name: codecov-umbrella
|
||||
fail_ci_if_error: true
|
||||
flags: wasm
|
||||
uses: pion/.goassets/.github/workflows/test-wasm.reusable.yml@master
|
||||
with:
|
||||
go-version: '1.19' # auto-update/latest-go-version
|
||||
|
27
.github/workflows/tidy-check.yaml
vendored
27
.github/workflows/tidy-check.yaml
vendored
@@ -12,31 +12,12 @@
|
||||
name: Go mod tidy
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
Check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: '1.19' # auto-update/latest-go-version
|
||||
- name: check
|
||||
run: |
|
||||
go mod download
|
||||
go mod tidy
|
||||
if ! git diff --exit-code
|
||||
then
|
||||
echo "Not go mod tidied"
|
||||
exit 1
|
||||
fi
|
||||
tidy:
|
||||
uses: pion/.goassets/.github/workflows/tidy-check.reusable.yml@master
|
||||
with:
|
||||
go-version: '1.19' # auto-update/latest-go-version
|
||||
|
@@ -2,7 +2,7 @@
|
||||
# we would love to have you https://github.com/pion/webrtc/wiki/Contributing
|
||||
#
|
||||
# This file is auto generated, using git to list all individuals contributors.
|
||||
# see `.github/generate-authors.sh` for the scripting
|
||||
# see https://github.com/pion/.goassets/blob/master/scripts/generate-authors.sh for the scripting
|
||||
a-wing <1@233.email>
|
||||
Aaron Boushley <boushley@pretzelaux.com>
|
||||
Aaron France <aaron.l.france@gmail.com>
|
||||
@@ -91,6 +91,7 @@ John Bradley <jrb@turrettech.com>
|
||||
John Selbie <jselbie@gmail.com>
|
||||
JooYoung <qkdlql@naver.com>
|
||||
Jorropo <jorropo.pgm@gmail.com>
|
||||
Josh Bleecher Snyder <josharian@gmail.com>
|
||||
juberti <juberti@alphaexplorationco.com>
|
||||
Juliusz Chroboczek <jch@irif.fr>
|
||||
Justin Okamoto <jdokamoto@gmail.com>
|
||||
@@ -164,6 +165,7 @@ Sean DuBois <sean@siobud.com>
|
||||
Sean DuBois <sean_dubois@apple.com>
|
||||
Sean Knight <git@seanknight.com>
|
||||
Sebastian Waisbrot <seppo0010@gmail.com>
|
||||
Sidney San Martín <sidney@s4y.us>
|
||||
Simon Eisenmann <simon@longsleep.org>
|
||||
simonacca-fotokite <47634061+simonacca-fotokite@users.noreply.github.com>
|
||||
Simone Gotti <simone.gotti@gmail.com>
|
||||
|
Reference in New Issue
Block a user