2024-09-21 20:55:23 +00:00
|
|
|
name: CI
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
branches: [master]
|
|
|
|
|
2024-10-14 14:33:42 +00:00
|
|
|
env:
|
|
|
|
RESTIC_VERSION: "0.17.1"
|
|
|
|
|
2024-09-21 20:55:23 +00:00
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
2024-10-14 14:33:42 +00:00
|
|
|
|
|
|
|
- name: Install restic@${{ env.RESTIC_VERSION }}
|
|
|
|
run: |
|
|
|
|
mkdir -p tools/restic
|
|
|
|
curl --fail --location --silent --show-error --output tools/restic/restic.bz2 \
|
|
|
|
"https://github.com/restic/restic/releases/download/v${RESTIC_VERSION}/restic_${RESTIC_VERSION}_linux_amd64.bz2"
|
|
|
|
bzip2 -d tools/restic/restic.bz2
|
|
|
|
chmod +x tools/restic/restic
|
|
|
|
echo "$GITHUB_WORKSPACE/tools/restic" >> "$GITHUB_PATH"
|
|
|
|
- run: restic version
|
|
|
|
|
2024-09-21 20:55:23 +00:00
|
|
|
- uses: actions/setup-go@v3
|
|
|
|
with:
|
|
|
|
go-version: '^1.21'
|
|
|
|
- run: go test -v ./...
|
|
|
|
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-go@v3
|
|
|
|
with:
|
|
|
|
go-version: '^1.21'
|
|
|
|
- run: go build -v .
|