Skip to content

Commit

Permalink
Update CI configs to v0.11.1
Browse files Browse the repository at this point in the history
Update lint scripts and CI configs.
  • Loading branch information
pionbot authored and Sean-Der committed Jan 3, 2024
1 parent 6f02656 commit b2c4793
Show file tree
Hide file tree
Showing 78 changed files with 577 additions and 141 deletions.
4 changes: 4 additions & 0 deletions .github/.gitignore
@@ -0,0 +1,4 @@
# SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>
# SPDX-License-Identifier: MIT

.goassets
31 changes: 31 additions & 0 deletions .github/fetch-scripts.sh
@@ -0,0 +1,31 @@
#!/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.
#
# SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>
# SPDX-License-Identifier: MIT

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
20 changes: 20 additions & 0 deletions .github/install-hooks.sh
@@ -0,0 +1,20 @@
#!/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.
#
# SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>
# SPDX-License-Identifier: MIT

SCRIPT_PATH="$(realpath "$(dirname "$0")")"

. ${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"
28 changes: 28 additions & 0 deletions .github/workflows/codeql-analysis.yml
@@ -0,0 +1,28 @@
#
# 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.
#
# SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>
# SPDX-License-Identifier: MIT

name: CodeQL

on:
workflow_dispatch:
schedule:
- cron: '23 5 * * 0'
pull_request:
branches:
- master
paths:
- '**.go'

jobs:
analyze:
uses: pion/.goassets/.github/workflows/codeql-analysis.reusable.yml@master
77 changes: 15 additions & 62 deletions .github/workflows/lint.yaml
@@ -1,67 +1,20 @@
#
# 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.
#
# SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>
# SPDX-License-Identifier: MIT

name: Lint
on:
push:
branches:
- master
pull_request:
branches:
- master
schedule:
- cron: "0 0 * * 1"


jobs:
lint-commit-message:
name: Metadata
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Checkout .goassets
uses: actions/checkout@v3
with:
repository: pion/.goassets
path: ${{ github.workspace }}/.github/.goassets
ref: ${{ inputs.goassets-ref }}

- name: Commit Message
run: .github/.goassets/scripts/lint-commit-message.sh

- name: File names
run: .github/.goassets/scripts/lint-filename.sh

- name: Logging messages should not have trailing newlines
run: .github/.goassets/scripts/lint-no-trailing-newline-in-log-messages.sh

- name: Go version in go.mod
run: .github/.goassets/scripts/lint-go-mod-version.sh

lint-go:
name: Go
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
steps:
- uses: actions/checkout@v3

- uses: actions/setup-go@v4
with:
go-version: 'stable'

- name: Update packages
run: sudo apt-get update

- name: Install GStreamer
run: |
sudo apt-get purge -y libunwind-14-dev
sudo apt-get install -y libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
- name: Build data-channels
run: cd c-data-channels && make

- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.52.2
lint:
uses: pion/.goassets/.github/workflows/lint.reusable.yml@master
24 changes: 24 additions & 0 deletions .github/workflows/release.yml
@@ -0,0 +1,24 @@
#
# 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.
#
# SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>
# SPDX-License-Identifier: MIT

name: Release
on:
push:
tags:
- 'v*'

jobs:
release:
uses: pion/.goassets/.github/workflows/release.reusable.yml@master
with:
go-version: '1.20' # auto-update/latest-go-version
24 changes: 24 additions & 0 deletions .github/workflows/renovate-go-sum-fix.yaml
@@ -0,0 +1,24 @@
#
# 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.
#
# SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>
# SPDX-License-Identifier: MIT

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 }}
22 changes: 22 additions & 0 deletions .github/workflows/reuse.yml
@@ -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.
#
# SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>
# SPDX-License-Identifier: MIT

name: REUSE Compliance Check

on:
push:
pull_request:

jobs:
lint:
uses: pion/.goassets/.github/workflows/reuse.reusable.yml@master
43 changes: 43 additions & 0 deletions .github/workflows/test.yaml
@@ -0,0 +1,43 @@
#
# 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.
#
# SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>
# SPDX-License-Identifier: MIT

name: Test
on:
push:
branches:
- master
pull_request:

jobs:
test:
uses: pion/.goassets/.github/workflows/test.reusable.yml@master
strategy:
matrix:
go: ['1.20', '1.19'] # auto-update/supported-go-version-list
fail-fast: false
with:
go-version: ${{ matrix.go }}

test-i386:
uses: pion/.goassets/.github/workflows/test-i386.reusable.yml@master
strategy:
matrix:
go: ['1.20', '1.19'] # auto-update/supported-go-version-list
fail-fast: false
with:
go-version: ${{ matrix.go }}

test-wasm:
uses: pion/.goassets/.github/workflows/test-wasm.reusable.yml@master
with:
go-version: '1.20' # auto-update/latest-go-version
25 changes: 25 additions & 0 deletions .github/workflows/tidy-check.yaml
@@ -0,0 +1,25 @@
#
# 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.
#
# SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>
# SPDX-License-Identifier: MIT

name: Go mod tidy
on:
pull_request:
push:
branches:
- master

jobs:
tidy:
uses: pion/.goassets/.github/workflows/tidy-check.reusable.yml@master
with:
go-version: '1.20' # auto-update/latest-go-version
30 changes: 26 additions & 4 deletions .gitignore
@@ -1,6 +1,28 @@
sfu-ws/cert.pem
sfu-ws/key.pem
# SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>
# SPDX-License-Identifier: MIT

*.ogg
### JetBrains IDE ###
#####################
.idea/

### Emacs Temporary Files ###
#############################
*~

### Folders ###
###############
bin/
vendor/
node_modules/

### Files ###
#############
*.ivf
*.h264
*.ogg
tags
cover.out
*.sw[poe]
*.wasm
examples/sfu-ws/cert.pem
examples/sfu-ws/key.pem
wasm_exec.js

0 comments on commit b2c4793

Please sign in to comment.