chore(go): update to go 1.22 (#3708)

* chore(go): update to go 1.22

* fix: install go before running codeql to fix autobild

* chore(test): explicitly set base crosscompile image

* fix(test): do not point at image with incorrect version of Go
This commit is contained in:
Gabe Kangas 2024-04-22 13:23:52 -07:00 committed by GitHub
parent ac0204104d
commit 439da013d8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 44 additions and 39 deletions

View file

@ -40,7 +40,7 @@ jobs:
- uses: actions/setup-go@v5 - uses: actions/setup-go@v5
with: with:
go-version: '1.21' go-version: '1.22'
cache: true cache: true
- name: Install Google Chrome - name: Install Google Chrome

View file

@ -9,16 +9,16 @@
# the `language` matrix defined below to confirm you have the correct set of # the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages. # supported CodeQL languages.
# #
name: "CodeQL" name: 'CodeQL'
on: on:
push: push:
branches: [ develop ] branches: [develop]
paths-ignore: paths-ignore:
- 'static/**' - 'static/**'
pull_request: pull_request:
# The branches below must be a subset of the branches above # The branches below must be a subset of the branches above
branches: [ develop ] branches: [develop]
paths-ignore: paths-ignore:
- 'static/**' - 'static/**'
@ -30,41 +30,46 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
language: [ 'go', 'javascript' ] language: ['go', 'javascript']
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more: # Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v4
# Initializes the CodeQL tools for scanning. - uses: actions/setup-go@v5
- name: Initialize CodeQL with:
uses: github/codeql-action/init@v3 go-version: '1.22'
with: cache: true
languages: ${{ matrix.language }}
config-file: ./.github/codeql/${{ matrix.language }}.yml
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # Initializes the CodeQL tools for scanning.
# If this step fails, then you should remove it and run the build manually (see below) - name: Initialize CodeQL
- name: Autobuild uses: github/codeql-action/init@v3
uses: github/codeql-action/autobuild@v3 with:
languages: ${{ matrix.language }}
config-file: ./.github/codeql/${{ matrix.language }}.yml
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# Command-line programs to run using the OS shell. # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# 📚 https://git.io/JvXDl # If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines # Command-line programs to run using the OS shell.
# and modify them (or add more) to build your code if your project # 📚 https://git.io/JvXDl
# uses a compiled language
#- run: | # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# make bootstrap # and modify them (or add more) to build your code if your project
# make release # uses a compiled language
- name: Perform CodeQL Analysis #- run: |
uses: github/codeql-action/analyze@v3 # make bootstrap
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3

View file

@ -28,7 +28,7 @@ jobs:
- uses: actions/setup-go@v5 - uses: actions/setup-go@v5
with: with:
go-version: '1.21' go-version: '1.22'
cache: true cache: true
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: golangci-lint - name: golangci-lint

View file

@ -12,7 +12,7 @@ jobs:
test: test:
strategy: strategy:
matrix: matrix:
go-version: [1.20.x, 1.21.x] go-version: [1.21.x, 1.22.x]
os: [ubuntu-latest, macos-latest, windows-latest] os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:

View file

@ -27,7 +27,7 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions/setup-go@v5 - uses: actions/setup-go@v5
with: with:
go-version: '1.21' go-version: '1.22'
cache: true cache: true
- name: Cache node modules - name: Cache node modules

View file

@ -17,7 +17,7 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions/setup-go@v5 - uses: actions/setup-go@v5
with: with:
go-version: '1.21' go-version: '1.22'
cache: true cache: true
- name: Cache node modules - name: Cache node modules

View file

@ -5,7 +5,7 @@ run:
# Define the Go version limit. # Define the Go version limit.
# Mainly related to generics support in go1.18. # Mainly related to generics support in go1.18.
# Default: use Go version from the go.mod file, fallback on the env var `GOVERSION`, fallback on 1.18 # Default: use Go version from the go.mod file, fallback on the env var `GOVERSION`, fallback on 1.18
go: '1.21' go: '1.22'
issues: issues:
# The linter has a default list of ignorable errors. Turning this on will enable that list. # The linter has a default list of ignorable errors. Turning this on will enable that list.
@ -69,7 +69,7 @@ linters-settings:
gosimple: gosimple:
# Select the Go version to target. The default is '1.13'. # Select the Go version to target. The default is '1.13'.
go: '1.21' go: '1.22'
# https://staticcheck.io/docs/options#checks # https://staticcheck.io/docs/options#checks
checks: ['all'] checks: ['all']

View file

@ -95,7 +95,7 @@ The Owncast backend is a service written in Go.
1. Ensure you have prerequisites installed. 1. Ensure you have prerequisites installed.
- C compiler, such as [GCC compiler](https://gcc.gnu.org/install/download.html) or a [Musl-compatible compiler](https://musl.libc.org/) - C compiler, such as [GCC compiler](https://gcc.gnu.org/install/download.html) or a [Musl-compatible compiler](https://musl.libc.org/)
- [ffmpeg](https://ffmpeg.org/download.html) - [ffmpeg](https://ffmpeg.org/download.html)
1. Install the [Go toolchain](https://golang.org/dl/) (1.21 or above). 1. Install the [Go toolchain](https://golang.org/dl/) (1.22 or above).
1. Clone the repo. `git clone https://github.com/owncast/owncast` 1. Clone the repo. `git clone https://github.com/owncast/owncast`
1. `go run main.go` will run from the source. 1. `go run main.go` will run from the source.
1. Visit `http://yourserver:8080` to access the web interface or `http://yourserver:8080/admin` to access the admin. 1. Visit `http://yourserver:8080` to access the web interface or `http://yourserver:8080/admin` to access the admin.

2
go.mod
View file

@ -1,6 +1,6 @@
module github.com/owncast/owncast module github.com/owncast/owncast
go 1.21 go 1.22
require ( require (
github.com/aws/aws-sdk-go v1.51.23 github.com/aws/aws-sdk-go v1.51.23