Added devcontainer #624
This file contains hidden or 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: Test | |
| on: | |
| push: | |
| branches: [ "master", "test-github-actions" ] | |
| pull_request: | |
| branches: [ "master" ] | |
| jobs: | |
| test-cpu: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [windows-latest] | |
| env: | |
| FFMPEG_VERSION: n7.0 | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - if: ${{ runner.os == 'Windows' }} | |
| name: Prepare windows | |
| run: | | |
| echo "FFMPEG_PATH=$(cygpath -u $(cd ~ && pwd))/ffmpeg" >> $env:GITHUB_ENV | |
| choco install --allow-empty-checksums pkgconfiglite | |
| - if: ${{ runner.os != 'Windows' }} | |
| name: Prepare non windows | |
| run: | | |
| echo "FFMPEG_PATH=$(echo ~)/ffmpeg" >> $GITHUB_ENV | |
| - if: ${{ runner.os == 'Windows' }} | |
| name: Set windows ffmpeg cache path | |
| run: | | |
| echo "FFMPEG_CACHE_PATH=$(cygpath -w ${{ env.FFMPEG_PATH }})" >> $env:GITHUB_ENV | |
| - if: ${{ runner.os != 'Windows' }} | |
| name: Set non-windows ffmpeg cache path | |
| run: | | |
| echo "FFMPEG_CACHE_PATH=${{ env.FFMPEG_PATH }}" >> $GITHUB_ENV | |
| - name: Load ffmpeg cache | |
| id: load-ffmpeg-cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ env.FFMPEG_CACHE_PATH }} | |
| key: ffmpeg-${{ env.FFMPEG_VERSION }}-${{ runner.os }} | |
| - if: ${{ steps.load-ffmpeg-cache.outputs.cache-hit != 'true' && runner.os == 'Linux' }} | |
| name: Prepare linux ffmpeg install | |
| run: | | |
| sudo apt-get install yasm | |
| touch /tmp/linux.patch | |
| echo "FFMPEG_PATCH_PATH=/tmp/linux.patch" >> $GITHUB_ENV | |
| - if: ${{ steps.load-ffmpeg-cache.outputs.cache-hit != 'true' && runner.os == 'macOS' }} | |
| name: Prepare macos ffmpeg install | |
| run: | | |
| brew install yasm | |
| touch /tmp/macos.patch | |
| echo "FFMPEG_PATCH_PATH=/tmp/macos.patch" >> $GITHUB_ENV | |
| - if: ${{ steps.load-ffmpeg-cache.outputs.cache-hit != 'true' && runner.os == 'Windows' }} | |
| name: Prepare windows ffmpeg install | |
| run: | | |
| choco install make | |
| choco install yasm | |
| echo "FFMPEG_PATCH_PATH='${{ github.WORKSPACE }}/.github/workflows/windows.patch'" >> $env:GITHUB_ENV | |
| - if: ${{ steps.load-ffmpeg-cache.outputs.cache-hit != 'true' }} | |
| name: Install ffmpeg | |
| run: | | |
| mkdir -p ${{ env.FFMPEG_PATH }}/src | |
| cd ${{ env.FFMPEG_PATH }}/src | |
| git clone https://github.com/FFmpeg/FFmpeg . | |
| git checkout ${{ env.FFMPEG_VERSION }} | |
| echo "bite 1" | |
| ./configure --prefix=.. | |
| echo "bite 2" | |
| make | |
| make install | |
| - if: ${{ steps.load-ffmpeg-cache.outputs.cache-hit != 'true' }} | |
| name: Save ffmpeg cache | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: ${{ env.FFMPEG_CACHE_PATH }} | |
| key: ffmpeg-${{ env.FFMPEG_VERSION }}-${{ runner.os }} | |
| - if: ${{ runner.os == 'Windows' }} | |
| name: Set windows environment variables | |
| run: | | |
| echo "CGO_LDFLAGS=-L${{ env.FFMPEG_PATH }}/lib/" >> $env:GITHUB_ENV | |
| echo "CGO_CFLAGS=-I${{ env.FFMPEG_PATH }}/include/" >> $env:GITHUB_ENV | |
| echo "PKG_CONFIG_PATH=$(cygpath -w ${{ env.FFMPEG_PATH }}/lib/pkgconfig)" >> $env:GITHUB_ENV | |
| - if: ${{ runner.os != 'Windows' }} | |
| name: Set non-windows environment variables | |
| run: | | |
| echo "CGO_LDFLAGS=-L${{ env.FFMPEG_PATH }}/lib/" >> $GITHUB_ENV | |
| echo "CGO_CFLAGS=-I${{ env.FFMPEG_PATH }}/include/" >> $GITHUB_ENV | |
| echo "PKG_CONFIG_PATH=${{ env.FFMPEG_PATH }}/lib/pkgconfig" >> $GITHUB_ENV | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.21' | |
| - name: Install dependencies | |
| run: go mod download | |
| - if: ${{ runner.os == 'macOS' }} | |
| name: Fix MacOS libx11 bug (remove when unecessary) | |
| run: | | |
| ln -s /opt/homebrew/Cellar/libx11/1.8.11 /opt/homebrew/Cellar/libx11/1.8.10 | |
| - name: Run tests | |
| run: | | |
| go test -v -race -covermode atomic -coverprofile=covprofile ./... | |
| - if: github.event_name != 'pull_request' | |
| name: Send coverage | |
| env: | |
| COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }} | |
| run: | | |
| go install github.com/mattn/goveralls@latest | |
| goveralls -coverprofile=covprofile -service=github |