From 92c95183efa8d7618f7285c19e156b2e7792ed84 Mon Sep 17 00:00:00 2001 From: apmmachine Date: Mon, 7 Aug 2023 07:36:19 +0000 Subject: [PATCH 01/16] [workflow] gosigar --- .github/workflows/ci.yml | 48 +++++++++++++++++++++++++++++ .github/workflows/opentelemetry.yml | 17 ++++++++++ .go-version | 1 + 3 files changed, 66 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/opentelemetry.yml create mode 100644 .go-version diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..d32836027 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,48 @@ +--- +name: ci + +on: + workflow_dispatch: + push: + branches: + - main + paths-ignore: + - '**.md' + - '**.asciidoc' + pull_request: + paths-ignore: + - '**.md' + - '**.asciidoc' + +permissions: + contents: read + +## Concurrency only allowed in the main branch. +## So old builds running for old commits within the same Pull Request are cancelled +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-go@v4 + with: + go-version-file: .go-version + cache: true + cache-dependency-path: '**/go.sum' + + - name: Lint + run: |- + go mod tidy && git diff --exit-code + gofmt -l . | read && echo "Code differs from gofmt's style. Run 'gofmt -w .'" 1>&2 && exit 1 || true + go vet + + - name: Build + run: go build + + - name: Test + run: go test -v ./... diff --git a/.github/workflows/opentelemetry.yml b/.github/workflows/opentelemetry.yml new file mode 100644 index 000000000..703f56c83 --- /dev/null +++ b/.github/workflows/opentelemetry.yml @@ -0,0 +1,17 @@ +--- +name: OpenTelemetry Export Trace + +on: + workflow_run: + workflows: [ci] + types: [completed] + +jobs: + otel-export-trace: + runs-on: ubuntu-latest + steps: + - uses: elastic/apm-pipeline-library/.github/actions/opentelemetry@current + with: + vaultUrl: ${{ secrets.VAULT_ADDR }} + vaultRoleId: ${{ secrets.VAULT_ROLE_ID }} + vaultSecretId: ${{ secrets.VAULT_SECRET_ID }} diff --git a/.go-version b/.go-version new file mode 100644 index 000000000..5fb5a6b4f --- /dev/null +++ b/.go-version @@ -0,0 +1 @@ +1.20 From 3602ea53a291a7ff8170fe5b2ed72beef2af2226 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Mon, 7 Aug 2023 10:35:13 +0200 Subject: [PATCH 02/16] adapt GH actions to the existing CI --- .github/workflows/ci.yml | 106 ++++++++++++++++------------ .github/workflows/opentelemetry.yml | 29 ++++---- .go-version | 1 - 3 files changed, 74 insertions(+), 62 deletions(-) delete mode 100644 .go-version diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d32836027..4528419f6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,48 +1,60 @@ --- -name: ci - -on: - workflow_dispatch: - push: - branches: - - main - paths-ignore: - - '**.md' - - '**.asciidoc' - pull_request: - paths-ignore: - - '**.md' - - '**.asciidoc' - -permissions: - contents: read - -## Concurrency only allowed in the main branch. -## So old builds running for old commits within the same Pull Request are cancelled -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} - -jobs: - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-go@v4 - with: - go-version-file: .go-version - cache: true - cache-dependency-path: '**/go.sum' - - - name: Lint - run: |- - go mod tidy && git diff --exit-code - gofmt -l . | read && echo "Code differs from gofmt's style. Run 'gofmt -w .'" 1>&2 && exit 1 || true - go vet - - - name: Build - run: go build - - - name: Test - run: go test -v ./... + name: ci + + on: + workflow_dispatch: + push: + branches: + - master + paths-ignore: + - '**.md' + - '**.asciidoc' + pull_request: + paths-ignore: + - '**.md' + - '**.asciidoc' + + permissions: + contents: read + + ## Concurrency only allowed in the main branch. + ## So old builds running for old commits within the same Pull Request are cancelled + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} + + jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-go@v4 + + - name: Lint + run: |- + go mod tidy && git diff --exit-code + gofmt -l . | read && echo "Code differs from gofmt's style. Run 'gofmt -w .'" 1>&2 && exit 1 || true + go vet + + test: + strategy: + fail-fast: false + matrix: + go-version: ['1.15', '1.16'] + os: [macos-latest, ubuntu-latest, windows-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-go@v4 + with: + go-version: ${{ matrix.go-version }} + cache: true + cache-dependency-path: '**/go.sum' + + - name: Build + run: go build + + - name: Test + run: go test -v ./... diff --git a/.github/workflows/opentelemetry.yml b/.github/workflows/opentelemetry.yml index 703f56c83..b2ec57de2 100644 --- a/.github/workflows/opentelemetry.yml +++ b/.github/workflows/opentelemetry.yml @@ -1,17 +1,18 @@ --- -name: OpenTelemetry Export Trace + name: OpenTelemetry Export Trace -on: - workflow_run: - workflows: [ci] - types: [completed] + on: + workflow_run: + workflows: + - ci + types: [completed] -jobs: - otel-export-trace: - runs-on: ubuntu-latest - steps: - - uses: elastic/apm-pipeline-library/.github/actions/opentelemetry@current - with: - vaultUrl: ${{ secrets.VAULT_ADDR }} - vaultRoleId: ${{ secrets.VAULT_ROLE_ID }} - vaultSecretId: ${{ secrets.VAULT_SECRET_ID }} + jobs: + otel-export-trace: + runs-on: ubuntu-latest + steps: + - uses: elastic/apm-pipeline-library/.github/actions/opentelemetry@current + with: + vaultUrl: ${{ secrets.VAULT_ADDR }} + vaultRoleId: ${{ secrets.VAULT_ROLE_ID }} + vaultSecretId: ${{ secrets.VAULT_SECRET_ID }} diff --git a/.go-version b/.go-version deleted file mode 100644 index 5fb5a6b4f..000000000 --- a/.go-version +++ /dev/null @@ -1 +0,0 @@ -1.20 From 1563bc7af3b2668f5aae6d4602abee1fdf6249cd Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Mon, 7 Aug 2023 10:36:40 +0200 Subject: [PATCH 03/16] remove jenkins --- .ci/Jenkinsfile | 139 ------------------------------------------ .ci/jobs/defaults.yml | 19 ------ .ci/jobs/folders.yml | 10 --- .ci/jobs/main.yml | 44 ------------- 4 files changed, 212 deletions(-) delete mode 100644 .ci/Jenkinsfile delete mode 100644 .ci/jobs/defaults.yml delete mode 100644 .ci/jobs/folders.yml delete mode 100644 .ci/jobs/main.yml diff --git a/.ci/Jenkinsfile b/.ci/Jenkinsfile deleted file mode 100644 index d97a9ef02..000000000 --- a/.ci/Jenkinsfile +++ /dev/null @@ -1,139 +0,0 @@ -#!/usr/bin/env groovy - -@Library('apm@current') _ - -pipeline { - agent { label 'ubuntu-20 && immutable' } - environment { - REPO = 'gosigar' - BASE_DIR = "src/github.com/elastic/${env.REPO}" - PIPELINE_LOG_LEVEL='INFO' - } - options { - timeout(time: 1, unit: 'HOURS') - buildDiscarder(logRotator(numToKeepStr: '10', artifactNumToKeepStr: '10', daysToKeepStr: '30')) - timestamps() - ansiColor('xterm') - disableResume() - durabilityHint('PERFORMANCE_OPTIMIZED') - rateLimitBuilds(throttle: [count: 60, durationName: 'hour', userBoost: true]) - quietPeriod(10) - } - triggers { - issueCommentTrigger('(?i)(.*(?:jenkins\\W+)?run\\W+(?:the\\W+)?tests(?:\\W+please)?|/test).*') - } - stages { - stage('Checkout') { - steps { - deleteDir() - gitCheckout(basedir: "${BASE_DIR}") - stash allowEmpty: true, name: 'source', useDefaultExcludes: false - } - } - stage('Lint'){ - steps { - withGoEnv(){ - dir("${BASE_DIR}"){ - sh(label: 'lint', script: ''' - go mod tidy && git diff --exit-code - gofmt -l . | read && echo "Code differs from gofmt's style. Run 'gofmt -w .'" 1>&2 && exit 1 || true - ''') - sh(label: 'Go vet', script: 'go vet') - } - } - } - } - stage('Build and test'){ - matrix { - agent {label "${PLATFORM}"} - axes { - axis { - name 'GO_VERSION' - values '1.15.8', '1.16' - } - axis { - name 'PLATFORM' - values 'macosx&&x86_64', 'macosx&&arm64', 'ubuntu-20 && immutable', 'windows-2012-r2 && windows-immutable' - } - } - excludes { - exclude { - axis { - name 'GO_VERSION' - values '1.15.8' - } - axis { - name 'PLATFORM' - values 'macosx&&arm64' - } - } - exclude { - axis { - name 'GO_VERSION' - values '1.16' - } - axis { - name 'PLATFORM' - notValues 'macosx&&arm64' - } - } - } - stages { - stage('build'){ - steps { - deleteDir() - unstash 'source' - withGoEnv(version: env.GO_VERSION){ - dir("${BASE_DIR}"){ - cmd(label: 'Go build', script: 'go build') - } - } - } - } - stage('test'){ - steps { - withGoEnv(version: env.GO_VERSION){ - dir("${BASE_DIR}"){ - goTestJUnit(options: '-v ./...', output: 'junit-report.xml') - buildExamples() - } - } - } - post{ - cleanup{ - junit(testResults: "${BASE_DIR}/junit-report.xml", allowEmptyResults: true) - } - } - } - } - } - } - } - post { - cleanup { - notifyBuildResult(prComment: true) - } - } -} - -def getExamplesDirs(){ - return [ - "examples/df", - "examples/free", - "examples/ps", - "examples/uptime" - ] -} - -def buildExamples(){ - getExamplesDirs().each { exampleDir -> - cmd(label: "Build Example ${exampleDir}", script: "go build -o ${exampleDir}/out.exe ./${exampleDir}") - dir("${exampleDir}"){ - def prefix = '' - if(isUnix()){ - prefix = './' - } - cmd(label: "Running Example ${exampleDir}", script: "${prefix}out.exe") - } - } -} diff --git a/.ci/jobs/defaults.yml b/.ci/jobs/defaults.yml deleted file mode 100644 index bb26a2fca..000000000 --- a/.ci/jobs/defaults.yml +++ /dev/null @@ -1,19 +0,0 @@ - ---- - -##### GLOBAL METADATA - -- meta: - cluster: beats-ci - -##### JOB DEFAULTS - -- job: - logrotate: - numToKeep: 20 - node: linux - concurrent: true - publishers: - - email: - recipients: infra-root+build@elastic.co - prune-dead-branches: true diff --git a/.ci/jobs/folders.yml b/.ci/jobs/folders.yml deleted file mode 100644 index 472766f99..000000000 --- a/.ci/jobs/folders.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -#https://docs.openstack.org/infra/jenkins-job-builder/project_folder.html -- job: - name: Library - description: Library related Jobs - project-type: folder - -- view: - name: Library - view-type: list diff --git a/.ci/jobs/main.yml b/.ci/jobs/main.yml deleted file mode 100644 index 027cdb734..000000000 --- a/.ci/jobs/main.yml +++ /dev/null @@ -1,44 +0,0 @@ ---- -- job: - name: Library/gosigar - display-name: Go sigar - description: Jenkins pipeline for Go sigar is a golang implementation of the sigar API. - view: Beats - project-type: multibranch - script-path: .ci/Jenkinsfile - scm: - - github: - branch-discovery: no-pr - discover-pr-forks-strategy: merge-current - discover-pr-forks-trust: permission - discover-pr-origin: merge-current - discover-tags: true - head-filter-regex: '(master|main|PR-.*|v\d+\.\d+\.\d+)' - notification-context: 'gosigar' - repo: gosigar - repo-owner: elastic - credentials-id: 2a9602aa-ab9f-4e52-baf3-b71ca88469c7-UserAndToken - ssh-checkout: - credentials: f6c7695a-671e-4f4f-a331-acdce44ff9ba - build-strategies: - - tags: - ignore-tags-older-than: -1 - ignore-tags-newer-than: -1 - - regular-branches: true - - change-request: - ignore-target-only-changes: false - clean: - after: true - before: true - prune: true - shallow-clone: true - depth: 4 - do-not-fetch-tags: true - submodule: - disable: false - recursive: true - parent-credentials: true - timeout: 100 - timeout: '15' - use-author: true - wipe-workspace: 'True' From 012135eab63b85e71d1f3503437b240e08d4b293 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Mon, 7 Aug 2023 10:36:46 +0200 Subject: [PATCH 04/16] update badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ab8f5bcfe..18cabdb4d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Go sigar [![Build Status](https://beats-ci.elastic.co/job/Beats/job/gosigar/job/master/badge/icon)](https://beats-ci.elastic.co/job/Beats/job/gosigar/job/master/) +# Go sigar [![ci](https://github.com/elastic/gosigar/actions/workflows/ci.yml/badge.svg)](https://github.com/elastic/gosigar/actions/workflows/ci.yml) ## Overview From 44c318dc1e5151069bb79bd5451461a44fa87a95 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Mon, 7 Aug 2023 10:49:13 +0200 Subject: [PATCH 05/16] enable examples --- .github/examples.bat | 7 +++++++ .github/examples.sh | 8 ++++++++ .github/workflows/ci.yml | 3 +++ 3 files changed, 18 insertions(+) create mode 100644 .github/examples.bat create mode 100755 .github/examples.sh diff --git a/.github/examples.bat b/.github/examples.bat new file mode 100644 index 000000000..44573c0f0 --- /dev/null +++ b/.github/examples.bat @@ -0,0 +1,7 @@ + +for %%exampleDir in (examples/df examples/free examples/ps examples/uptime) do ( + go build -o %%exampleDir/out.exe ./%%exampleDir + cd %%exampleDir + out.exe + cd .. +) diff --git a/.github/examples.sh b/.github/examples.sh new file mode 100755 index 000000000..170d8aef9 --- /dev/null +++ b/.github/examples.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +for exampleDir in "examples/df" "examples/free" "examples/ps" "examples/uptime" ; do + go build -o ${exampleDir}/out.exe ./${exampleDir} + pushd ${exampleDir} + ./out.exe + popd +done diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4528419f6..a39c04491 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,3 +58,6 @@ - name: Test run: go test -v ./... + + - name: Run examples + run: ${{ startsWith(matrix.os,'windows') && '.github/examples.bat' || '.github/examples.sh' }} From 73a04afb513fb9f722095c159f005d4955859cf0 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Mon, 7 Aug 2023 10:52:41 +0200 Subject: [PATCH 06/16] use windows-2019 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a39c04491..ebdddcc34 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,7 +42,7 @@ fail-fast: false matrix: go-version: ['1.15', '1.16'] - os: [macos-latest, ubuntu-latest, windows-latest] + os: [macos-latest, ubuntu-latest, windows-2019] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 From 63b9e04725fc07de7428f6b798c163bede875617 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Mon, 7 Aug 2023 10:54:05 +0200 Subject: [PATCH 07/16] use go.mod for the goversion --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ebdddcc34..bea28965d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,6 +30,8 @@ - uses: actions/checkout@v3 - uses: actions/setup-go@v4 + with: + go-version-file: 'go.mod' - name: Lint run: |- From 7621da38f60488523c57a91a1c2eaf0e7a67ba4f Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Mon, 7 Aug 2023 11:07:20 +0200 Subject: [PATCH 08/16] Skip tests that are failing on Wiindows 2019/2022 See https://github.com/elastic/gosigar/issues/172 --- sys/windows/syscall_windows_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/windows/syscall_windows_test.go b/sys/windows/syscall_windows_test.go index bde47a82c..7b8bb361d 100644 --- a/sys/windows/syscall_windows_test.go +++ b/sys/windows/syscall_windows_test.go @@ -92,6 +92,10 @@ func TestEnumProcesses(t *testing.T) { } func TestGetDiskFreeSpaceEx(t *testing.T) { + if runtime.GOOS == "windows" { + t.Skip("test is not running on latest windows versions. See https://github.com/elastic/gosigar/issues/172") + return + } drives, err := GetLogicalDriveStrings() if err != nil { t.Fatal(err) @@ -393,6 +397,10 @@ func TestGetVolumes(t *testing.T) { } func TestGetVolumePathsForVolume(t *testing.T) { + if runtime.GOOS == "windows" { + t.Skip("test is not running on latest windows versions. See https://github.com/elastic/gosigar/issues/172") + return + } volumes, err := GetVolumes() if err != nil { t.Fatal(err) From 8e0bc73f48b3b55401de4554bdd1cea14b1eb209 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Mon, 7 Aug 2023 11:16:19 +0200 Subject: [PATCH 09/16] Apply suggestions from code review --- .github/examples.bat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/examples.bat b/.github/examples.bat index 44573c0f0..19aec931c 100644 --- a/.github/examples.bat +++ b/.github/examples.bat @@ -1,7 +1,7 @@ for %%exampleDir in (examples/df examples/free examples/ps examples/uptime) do ( - go build -o %%exampleDir/out.exe ./%%exampleDir - cd %%exampleDir + go build -o %%exampleDir%%/out.exe ./%%exampleDir%% + cd %%exampleDir%% out.exe cd .. ) From 9cb5d98b656683294e03b579bcef8e1737468d64 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Mon, 7 Aug 2023 11:26:11 +0200 Subject: [PATCH 10/16] windows: iterate in batch through the list of examples --- .github/examples.bat | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/examples.bat b/.github/examples.bat index 19aec931c..f23724ed2 100644 --- a/.github/examples.bat +++ b/.github/examples.bat @@ -1,7 +1,9 @@ - -for %%exampleDir in (examples/df examples/free examples/ps examples/uptime) do ( - go build -o %%exampleDir%%/out.exe ./%%exampleDir%% - cd %%exampleDir%% +@echo off +set examples=examples/df examples/free examples/ps examples/uptime +(for %%i in (%examples%) do ( + echo %%a + go build -o %%i/out.exe ./%%i + cd %%i out.exe cd .. -) +)) From e0f34709fddf3c0db86bc03ed4b1e4644056e43e Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Mon, 7 Aug 2023 11:30:44 +0200 Subject: [PATCH 11/16] use pushd popd --- .github/examples.bat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/examples.bat b/.github/examples.bat index f23724ed2..a911e96bb 100644 --- a/.github/examples.bat +++ b/.github/examples.bat @@ -3,7 +3,7 @@ set examples=examples/df examples/free examples/ps examples/uptime (for %%i in (%examples%) do ( echo %%a go build -o %%i/out.exe ./%%i - cd %%i + pushd %%i out.exe - cd .. + popd )) From 766e9a54cd1d6e8df01df831dfc1eb4962457d7d Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Mon, 7 Aug 2023 11:30:59 +0200 Subject: [PATCH 12/16] use latest instead --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bea28965d..8a0413ec8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,7 +44,7 @@ fail-fast: false matrix: go-version: ['1.15', '1.16'] - os: [macos-latest, ubuntu-latest, windows-2019] + os: [macos-latest, ubuntu-latest, windows-latest] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 From 4fc603a3cf2c9aae342d77340e6c504b485d2705 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Mon, 7 Aug 2023 11:35:08 +0200 Subject: [PATCH 13/16] Apply suggestions from code review --- .github/examples.bat | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/examples.bat b/.github/examples.bat index a911e96bb..7a1601d4a 100644 --- a/.github/examples.bat +++ b/.github/examples.bat @@ -1,9 +1,5 @@ -@echo off set examples=examples/df examples/free examples/ps examples/uptime (for %%i in (%examples%) do ( - echo %%a go build -o %%i/out.exe ./%%i - pushd %%i - out.exe - popd + %%i/out.exe )) From 20b26919086a20a16116e4104d2bc6e61da8d81f Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Mon, 7 Aug 2023 11:37:29 +0200 Subject: [PATCH 14/16] use windows path --- .github/examples.bat | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/examples.bat b/.github/examples.bat index 7a1601d4a..1e1453572 100644 --- a/.github/examples.bat +++ b/.github/examples.bat @@ -1,5 +1,5 @@ -set examples=examples/df examples/free examples/ps examples/uptime +set examples=examples\df examples\free examples\ps examples\uptime (for %%i in (%examples%) do ( - go build -o %%i/out.exe ./%%i - %%i/out.exe + go build -o %%i\out.exe ./%%i + %%i\out.exe )) From 66d7872c7afcbef7425aabb47cb8281c8ca547eb Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Mon, 7 Aug 2023 11:54:59 +0200 Subject: [PATCH 15/16] ci: enable ci-docs --- .github/workflows/ci-docs.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/ci-docs.yml diff --git a/.github/workflows/ci-docs.yml b/.github/workflows/ci-docs.yml new file mode 100644 index 000000000..dbc543f39 --- /dev/null +++ b/.github/workflows/ci-docs.yml @@ -0,0 +1,20 @@ +--- +# This workflow sets the "ci" status check to success in case it's a docs only PR and ci.yml is not triggered +# https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks +name: ci # The name must be the same as in ci.yml + +on: + pull_request: + paths-ignore: # This expression needs to match the paths ignored on test.yml. + - '**' + - '!**/*.md' + - '!**/*.asciidoc' + +permissions: + contents: read + +jobs: + test: + runs-on: ubuntu-latest + steps: + - run: echo "No build required" From b6113fa534c56e882b01069bfede3a4070380a3c Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Mon, 7 Aug 2023 12:13:47 +0200 Subject: [PATCH 16/16] ci: remove filter path to avoid issues with matrix --- .github/workflows/ci-docs.yml | 20 -------------------- .github/workflows/ci.yml | 6 ------ 2 files changed, 26 deletions(-) delete mode 100644 .github/workflows/ci-docs.yml diff --git a/.github/workflows/ci-docs.yml b/.github/workflows/ci-docs.yml deleted file mode 100644 index dbc543f39..000000000 --- a/.github/workflows/ci-docs.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -# This workflow sets the "ci" status check to success in case it's a docs only PR and ci.yml is not triggered -# https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks -name: ci # The name must be the same as in ci.yml - -on: - pull_request: - paths-ignore: # This expression needs to match the paths ignored on test.yml. - - '**' - - '!**/*.md' - - '!**/*.asciidoc' - -permissions: - contents: read - -jobs: - test: - runs-on: ubuntu-latest - steps: - - run: echo "No build required" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8a0413ec8..4c5a5b139 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,13 +6,7 @@ push: branches: - master - paths-ignore: - - '**.md' - - '**.asciidoc' pull_request: - paths-ignore: - - '**.md' - - '**.asciidoc' permissions: contents: read