mirror of
https://github.com/docker/docker-credential-helpers.git
synced 2026-06-13 16:01:28 +05:30
ci: add test jobs
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
@@ -11,10 +11,71 @@ on:
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
DESTDIR: ./bin
|
DESTDIR: ./bin
|
||||||
|
GO_VERSION: 1.16.7
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os:
|
||||||
|
- ubuntu-20.04
|
||||||
|
- macOS-11
|
||||||
|
- windows-2022
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
-
|
||||||
|
name: Set up Go
|
||||||
|
uses: actions/setup-go@v3
|
||||||
|
with:
|
||||||
|
go-version: ${{ env.GO_VERSION }}
|
||||||
|
cache: true
|
||||||
|
-
|
||||||
|
name: Install deps
|
||||||
|
if: ${{ matrix.os == 'ubuntu-20.04' }}
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y dbus-x11 gnome-keyring libsecret-1-dev pass
|
||||||
|
-
|
||||||
|
name: Test
|
||||||
|
run: |
|
||||||
|
go test -short -v -coverprofile=./coverage.txt -covermode=atomic ./...
|
||||||
|
go tool cover -func=./coverage.txt
|
||||||
|
shell: bash
|
||||||
|
-
|
||||||
|
name: Upload coverage
|
||||||
|
uses: codecov/codecov-action@v3
|
||||||
|
with:
|
||||||
|
file: ./coverage.txt
|
||||||
|
|
||||||
|
test-sandboxed:
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
-
|
||||||
|
name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
-
|
||||||
|
name: Test
|
||||||
|
uses: docker/bake-action@v2
|
||||||
|
with:
|
||||||
|
targets: test
|
||||||
|
set: |
|
||||||
|
*.cache-from=type=gha,scope=test
|
||||||
|
*.cache-to=type=gha,scope=test,mode=max
|
||||||
|
-
|
||||||
|
name: Upload coverage
|
||||||
|
uses: codecov/codecov-action@v3
|
||||||
|
with:
|
||||||
|
file: ${{ env.DESTDIR }}//coverage.txt
|
||||||
|
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
@@ -30,6 +91,9 @@ jobs:
|
|||||||
uses: docker/bake-action@v2
|
uses: docker/bake-action@v2
|
||||||
with:
|
with:
|
||||||
targets: binaries
|
targets: binaries
|
||||||
|
set: |
|
||||||
|
*.cache-from=type=gha,scope=build
|
||||||
|
*.cache-to=type=gha,scope=build,mode=max
|
||||||
-
|
-
|
||||||
name: Move artifacts
|
name: Move artifacts
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
Reference in New Issue
Block a user