2019-11-15 23:11:17 -08:00
|
|
|
name: CI
|
2020-04-24 20:24:30 -07:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2021-12-31 13:54:15 +02:00
|
|
|
- main
|
2020-04-24 20:24:30 -07:00
|
|
|
pull_request:
|
|
|
|
branches:
|
2021-12-31 13:54:15 +02:00
|
|
|
- main
|
2019-11-15 23:11:17 -08:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: Build
|
|
|
|
runs-on: ${{ matrix.os }}
|
2020-10-04 13:21:57 -07:00
|
|
|
timeout-minutes: 10
|
|
|
|
|
2019-11-15 23:11:17 -08:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
2020-04-18 13:40:00 -07:00
|
|
|
|
2019-11-15 23:11:17 -08:00
|
|
|
steps:
|
2022-03-03 05:28:26 +00:00
|
|
|
- uses: actions/setup-go@v3
|
2019-11-15 23:11:17 -08:00
|
|
|
with:
|
2020-10-04 13:21:03 -07:00
|
|
|
go-version: 1.15
|
2022-03-02 01:36:31 +00:00
|
|
|
- uses: actions/checkout@v3
|
2020-10-04 13:21:03 -07:00
|
|
|
- run: make build
|
2021-12-31 10:47:04 +00:00
|
|
|
- uses: actions/upload-artifact@v2.3.1
|
2020-04-19 13:35:12 -07:00
|
|
|
with:
|
|
|
|
name: podsync-${{ matrix.os }}
|
|
|
|
path: bin/
|
2019-11-15 23:11:17 -08:00
|
|
|
|
|
|
|
test:
|
|
|
|
name: Test
|
|
|
|
runs-on: ubuntu-latest
|
2020-10-04 13:21:57 -07:00
|
|
|
timeout-minutes: 10
|
|
|
|
|
2019-11-15 23:11:17 -08:00
|
|
|
steps:
|
2022-03-03 05:28:26 +00:00
|
|
|
- uses: actions/setup-go@v3
|
2019-11-15 23:11:17 -08:00
|
|
|
with:
|
2020-10-04 13:21:03 -07:00
|
|
|
go-version: 1.15
|
2022-03-02 01:36:31 +00:00
|
|
|
- uses: actions/checkout@v3
|
2020-10-04 13:21:03 -07:00
|
|
|
- env:
|
2019-11-24 13:17:47 -08:00
|
|
|
VIMEO_TEST_API_KEY: ${{ secrets.VIMEO_ACCESS_TOKEN }}
|
|
|
|
YOUTUBE_TEST_API_KEY: ${{ secrets.YOUTUBE_API_KEY }}
|
2020-10-04 13:21:03 -07:00
|
|
|
run: make test
|
2019-11-15 23:11:17 -08:00
|
|
|
|
2020-04-18 13:40:00 -07:00
|
|
|
checks:
|
|
|
|
name: Checks
|
2019-11-15 23:11:17 -08:00
|
|
|
runs-on: ubuntu-latest
|
2020-10-04 13:21:57 -07:00
|
|
|
timeout-minutes: 10
|
|
|
|
|
2019-11-15 23:11:17 -08:00
|
|
|
steps:
|
2022-03-03 05:28:26 +00:00
|
|
|
- uses: actions/setup-go@v3
|
2022-03-02 01:36:31 +00:00
|
|
|
- uses: actions/checkout@v3
|
2022-02-25 01:27:28 +00:00
|
|
|
- uses: golangci/golangci-lint-action@v3
|
2021-12-31 14:26:34 +02:00
|
|
|
with:
|
|
|
|
version: v1.43.0
|
2020-04-18 13:40:00 -07:00
|
|
|
|
|
|
|
- name: Go mod
|
|
|
|
env:
|
|
|
|
DIFF_PATH: "go.mod go.sum"
|
|
|
|
run: |
|
|
|
|
go mod tidy
|
|
|
|
DIFF=$(git status --porcelain -- $DIFF_PATH)
|
|
|
|
if [ "$DIFF" ]; then
|
|
|
|
echo
|
|
|
|
echo "These files were modified:"
|
|
|
|
echo
|
|
|
|
echo "$DIFF"
|
|
|
|
echo
|
|
|
|
exit 1
|
|
|
|
fi
|