Skip to content

[forward port to master] tracing: allow the Resource to be set externally #2327

[forward port to master] tracing: allow the Resource to be set externally

[forward port to master] tracing: allow the Resource to be set externally #2327

Workflow file for this run

name: test-os
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
schedule:
- cron: '0 10 * * *'
workflow_dispatch:
push:
branches:
- 'master'
- 'v[0-9]+.[0-9]+'
pull_request:
paths-ignore:
- 'README.md'
- 'docs/**'
- 'frontend/dockerfile/docs/**'
env:
GO_VERSION: "1.21"
TESTFLAGS: "-v --parallel=6 --timeout=60m"
GOTESTSUM_VERSION: "v1.9.0" # same as one in Dockerfile
GOTESTSUM_FORMAT: "standard-verbose"
DESTDIR: "./bin"
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
# - ubuntu-22.04
# - macOS-11
- windows-2022
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "${{ env.GO_VERSION }}"
-
name: Install gotestsum
run: |
go install gotest.tools/gotestsum@${{ env.GOTESTSUM_VERSION }}
-
name: Install buildkitd.exe binary
run: |
go install .\cmd\buildkitd
-
name: Install containerd.exe binary
run: |
$goModFileContent = Get-Content go.mod -Raw
$pattern = '(?<=github\.com/containerd/containerd v)[\d\.]+'
$version = [regex]::Match($goModFileContent, $pattern).Value
mkdir -p .\bin\installs -f
cd .\bin\installs
git clone https://github.com/containerd/containerd.git
cd containerd
git checkout tags/v$version
go install .\cmd\...
cd ..\..\..
-
name: Install registry.exe (distribution/distribution) binary
run: |
mkdir -p .\bin\installs -f
cd .\bin\installs
git clone https://github.com/distribution/distribution.git
cd distribution
go install .\cmd\...
cd ..\..\..
-
name: Test
env:
TMPDIR: ${{ runner.temp }}
# SKIP_INTEGRATION_TESTS: 1
run: |
mkdir -p ./bin/testreports
gotestsum \
--jsonfile="./bin/testreports/go-test-report.json" \
--junitfile="./bin/testreports/junit-report.xml" \
--packages="./..." \
-- \
"-mod=vendor" \
"-coverprofile" "./bin/testreports/coverage.txt" \
"-covermode" "atomic" ${TESTFLAGS}
shell: bash
-
name: Send to Codecov
if: always()
uses: codecov/codecov-action@v3
with:
directory: ./bin/testreports
env_vars: RUNNER_OS
flags: unit
-
name: Generate annotations
if: always()
uses: crazy-max/.github/.github/actions/gotest-annotations@5af0882e0496d2f7e98a53ae4048e3d86682496f
with:
directory: ./bin/testreports
-
name: Upload test reports
if: always()
uses: actions/upload-artifact@v3
with:
name: test-reports
path: ./bin/testreports
-
name: Dump context
if: failure()
uses: crazy-max/ghaction-dump-context@v2
build-freebsd-amd64:
runs-on: ubuntu-22.04
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Build
uses: docker/bake-action@v4
with:
targets: binaries
set: |
*.platform=freebsd/amd64
-
name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: buildkit-freebsd-amd64
path: ${{ env.DESTDIR }}/*
if-no-files-found: error
retention-days: 1
test-freebsd-amd64:
runs-on: macos-13
needs:
- build-freebsd-amd64
env:
VAGRANT_VAGRANTFILE: hack/Vagrantfile.freebsd13
GOOS: freebsd
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Download artifacts
uses: actions/download-artifact@v3
with:
name: buildkit-freebsd-amd64
path: ${{ env.DESTDIR }}
-
name: Cache Vagrant boxes
uses: actions/cache@v3
with:
path: ~/.vagrant.d/boxes
key: ${{ runner.os }}-vagrant-${{ hashFiles('hack/Vagrantfile.freebsd13') }}
restore-keys: |
${{ runner.os }}-vagrant-
-
name: Install vagrant and VirtualBox
run: |
set -x
brew tap hashicorp/tap
brew install hashicorp/tap/hashicorp-vagrant
brew install --cask virtualbox
-
name: Check versions
run: |
set -x
vagrant --version
VBoxManage -v
-
name: Set up vagrant
run: |
vagrant up --no-tty
-
name: Smoke test
uses: nick-fields/retry@14672906e672a08bd6eeb15720e9ed3ce869cdd4 # v2.9.0
with:
timeout_minutes: 20
max_attempts: 5
command: |
vagrant up --provision-with=test-smoke
-
name: BuildKit logs
if: always()
run: |
vagrant ssh -- "sudo cat /vagrant/.tmp/logs/buildkitd"
-
name: Containerd logs
if: always()
run: |
vagrant ssh -- "sudo cat /vagrant/.tmp/logs/containerd"
-
name: Dump context
if: failure()
uses: crazy-max/ghaction-dump-context@v2