mirror of
https://github.com/docker/cli.git
synced 2026-11-14 08:43:00 -04:00
96 lines
3.0 KiB
YAML
96 lines
3.0 KiB
YAML
name: test
|
|
|
|
# Default to 'contents: read', which grants actions to read commits.
|
|
#
|
|
# If any permission is set, any permission not included in the list is
|
|
# implicitly set to "none".
|
|
#
|
|
# see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- 'master'
|
|
- '[0-9]+.[0-9]+'
|
|
- '[0-9]+.x'
|
|
tags:
|
|
- 'v*'
|
|
pull_request:
|
|
|
|
jobs:
|
|
ctn:
|
|
permissions:
|
|
contents: read
|
|
id-token: write # needed for CodeCov; https://github.com/codecov/codecov-action/blob/v7.1.1/README.md#using-oidc
|
|
runs-on: ubuntu-26.04
|
|
steps:
|
|
-
|
|
name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
|
|
-
|
|
name: Test
|
|
uses: docker/bake-action@59cb1203cd42bcefd40a1b6d73b589e48c86040e # v7.5.0
|
|
with:
|
|
targets: test-coverage
|
|
-
|
|
name: Send to Codecov
|
|
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
|
|
with:
|
|
files: ./build/coverage/coverage.txt
|
|
use_oidc: true
|
|
|
|
host:
|
|
permissions:
|
|
contents: read
|
|
id-token: write # needed for CodeCov; https://github.com/codecov/codecov-action/blob/v7.1.1/README.md#using-oidc
|
|
runs-on: ${{ matrix.os }}
|
|
env:
|
|
GOPATH: ${{ github.workspace }}
|
|
GOBIN: ${{ github.workspace }}/bin
|
|
GO111MODULE: auto
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os:
|
|
- macos-15 # macOS 15 on arm64 (Apple Silicon M1)
|
|
- macos-26 # macOS 26 on arm64 (Apple Silicon M1)
|
|
- macos-26-intel # macOS 26 on Intel
|
|
# - windows-2022 # FIXME: some tests are failing on the Windows runner, as well as on Appveyor since June 24, 2018: https://ci.appveyor.com/project/docker/cli/history
|
|
steps:
|
|
-
|
|
name: Checkout
|
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
path: ${{ env.GOPATH }}/src/github.com/docker/cli
|
|
persist-credentials: false
|
|
-
|
|
name: Set up Go
|
|
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
|
|
with:
|
|
go-version: "1.27.3"
|
|
cache: false
|
|
-
|
|
name: Test
|
|
run: |
|
|
# run in go modules mode to prevent traversing to nested modules
|
|
ln -s vendor.mod go.mod
|
|
ln -s vendor.sum go.sum
|
|
go test -coverprofile=/tmp/coverage.txt $(go list ./... | grep -vE '^github.com/docker/cli/e2e/')
|
|
go tool cover -func=/tmp/coverage.txt
|
|
working-directory: ${{ env.GOPATH }}/src/github.com/docker/cli
|
|
shell: bash
|
|
-
|
|
name: Send to Codecov
|
|
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
|
|
with:
|
|
files: /tmp/coverage.txt
|
|
working-directory: ${{ env.GOPATH }}/src/github.com/docker/cli
|
|
use_oidc: true
|