Bump depreaciated action warnings #103
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "ci" | |
on: | |
push: | |
branches: | |
- 'main' | |
tags: | |
- 'v*' | |
pull_request: | |
types: | |
- opened | |
- reopened | |
- synchronize | |
branches: | |
- 'main' | |
permissions: | |
contents: write | |
jobs: | |
lint: | |
name: Static code analysis | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source tree | |
uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'go.mod' | |
cache: false | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v4 | |
with: | |
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version | |
version: latest | |
build: | |
name: Build and test | |
strategy: | |
matrix: | |
include: | |
- ffmpeg_version: "v5.1.1" | |
ffmpeg_url: https://www.johnvansickle.com/ffmpeg/old-releases/ffmpeg-5.1.1-amd64-static.tar.xz | |
ffmpeg_md5: "4cbbe32169c4ec79a0969d5c92cbcaff" | |
- ffmpeg_version: "v6.1" | |
ffmpeg_url: https://www.johnvansickle.com/ffmpeg/releases/ffmpeg-6.1-amd64-static.tar.xz | |
ffmpeg_md5: "8a34e2ab52b72777a8dcd3ff5defbcd8" | |
runs-on: ubuntu-latest | |
env: | |
FFMPEG_DEST_DIR: /opt/ffmpeg-static | |
steps: | |
- name: Checkout source tree | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
# Cache for expensive static ffmpeg binary installation | |
- name: Cache for static ffmpeg | |
uses: actions/cache@v4 | |
id: cache-ffmpeg | |
with: | |
path: ${{ env.FFMPEG_DEST_DIR }} | |
key: ${{ runner.os }}-static-ffmpeg-${{ matrix.ffmpeg_version }} | |
# Only run this expensive step if we have a cache miss | |
- if: steps.cache-ffmpeg.outputs.cache-hit != 'true' | |
name: Install static ffmpeg ${{ matrix.ffmpeg_version }} | |
run: | | |
curl --connect-timeout 10 -Lv -o ffmpeg.tar.xz ${{ matrix.ffmpeg_url }} | |
echo "${{ matrix.ffmpeg_md5 }} ffmpeg.tar.xz" | md5sum --check - | |
mkdir -p "$FFMPEG_DEST_DIR" | |
tar -C "$FFMPEG_DEST_DIR" -xf ffmpeg.tar.xz --strip-components=1 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'go.mod' | |
cache: false | |
- name: Save Go cache paths | |
id: go-cache-paths | |
run: | | |
echo "go_mod_cache=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT | |
echo "go_cache=$(go env GOCACHE)" >> $GITHUB_OUTPUT | |
- name: Create Go module cache | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.go-cache-paths.outputs.go_mod_cache }} | |
key: ${{ runner.os }}-go_mod_cache-${{ hashFiles('go.sum') }} | |
- name: Create Go cache | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.go-cache-paths.outputs.go_cache }} | |
key: ${{ runner.os }}-go_cache-${{ hashFiles('go.sum') }} | |
- name: Verify module dependencies | |
run: go mod verify | |
- name: Test | |
run: | | |
export PATH="$FFMPEG_DEST_DIR":$PATH | |
ffmpeg -version | |
bash -x ./build.sh clean | |
bash -x ./build.sh test | |
- name: Build | |
id: build | |
run: | | |
export PATH="$FFMPEG_DEST_DIR":$PATH | |
bash -x ./build.sh clean | |
bash -x ./build.sh build | |
- name: Save build artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ease-${{ github.run_number }}_${{ matrix.ffmpeg_version }} | |
path: ${{ steps.build.outputs.artifact_path }} |