Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: port CircleCI jobs to GH Actions and improve sharness reporting #9355

Merged
merged 66 commits into from
Jan 13, 2023
Merged
Show file tree
Hide file tree
Changes from 52 commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
ca4b95c
ci: rewrite circleci jobs as github actions workflows
galargh Sep 13, 2022
c3a64b8
ci: fix build.yml
galargh Sep 13, 2022
08cba85
ci: fix sharness.yml
galargh Sep 13, 2022
f6fbe34
ci: add sleep in twonode test to hide flakiness
galargh Sep 14, 2022
d873053
ci: update codecov setup
galargh Sep 14, 2022
265cc78
feat: run heavy worfklows on self-hosted runners
galargh Sep 23, 2022
a5a8413
fix: runner.yml
galargh Sep 23, 2022
33bb868
fix: runner.yml
galargh Sep 23, 2022
abebd9c
fix: sharness.yml
galargh Sep 23, 2022
9794042
fix: sharness.yml
galargh Sep 23, 2022
2503b83
feat: include junit in upload
galargh Sep 23, 2022
78ee0da
feat: upgrade sharness and add JUnit HTML reporting
galargh Sep 28, 2022
0d4af6c
fix: sharness.yml
galargh Sep 28, 2022
fe1114f
fix: symlink sharness to test directory
galargh Sep 28, 2022
030e819
fix: test junit env var
galargh Sep 28, 2022
51f27e9
fix: sharness.yml
galargh Sep 28, 2022
762d78b
fix: junit html report generation
galargh Sep 29, 2022
c09a3f2
ci: install xmllint for sharness build
galargh Sep 29, 2022
3927f4d
chore: upgrade sharness so that sequences are escaped properly
galargh Sep 29, 2022
3ccec00
fix: execute html generation in bash
galargh Sep 29, 2022
96a52f7
chore: upgrade sharness
galargh Sep 29, 2022
ca53a7a
chore: do not print out control sequences from gateway car test
galargh Sep 29, 2022
8080d30
fix: XML report generation in CircleCI
galargh Sep 29, 2022
197d1f9
feat: allow configuring sharness coloring through env vars
galargh Sep 29, 2022
76b70d4
chore: upgrade sharness and junit XSLs
galargh Sep 29, 2022
fd83fc4
chore: expect success from fixed sharness tests
galargh Sep 29, 2022
20c6396
fix: sharness test setup
galargh Sep 29, 2022
ba204a9
fix: interop build on github actions
galargh Oct 13, 2022
b9e877c
ci: give github actions workflows names
galargh Oct 13, 2022
6c1ecca
feat: add reports to the sharness workflow
galargh Oct 19, 2022
97878ae
fix: action repository names
galargh Oct 19, 2022
fb92ce0
fix: working directory for the test reporter
galargh Oct 19, 2022
ee9503e
chore: remove broken test reporter
galargh Oct 19, 2022
35c6a37
chore: add step names and more sharness artifact uploads
galargh Oct 19, 2022
c2f5254
fix: actions/upload-artifact
galargh Oct 19, 2022
bcfc117
fix: out file for sharness
galargh Oct 19, 2022
fac48ca
chore: cleanup after testing in galorgh org
galargh Oct 19, 2022
f84a0c6
chore: mark newly added gh actions workflows as experimental
galargh Oct 19, 2022
47029ef
chore: enable testing gobuild and sharness workflow in ipfs
galargh Oct 19, 2022
7a93014
fix: install libxml2-tools on circleci
galargh Oct 19, 2022
c5a2788
chore: update ubuntu image on circleci
galargh Oct 19, 2022
3a6ce5d
chore: upload aggregate xml
galargh Oct 19, 2022
37ea70a
wip: upload partial XML parts and counts
galargh Oct 19, 2022
3c2aa36
fix: apostrophes in the docker image test
galargh Oct 19, 2022
9f93b12
fix: simple ipfs add/cat can be run in docker container
galargh Oct 19, 2022
925ce63
chore: display sharness out
galargh Oct 19, 2022
6adb328
Revert "wip: upload partial XML parts and counts"
galargh Oct 19, 2022
34d6a1a
Revert "chore: upload aggregate xml"
galargh Oct 19, 2022
e383874
fix: simple ipfs add/cat can be run in docker container
galargh Oct 19, 2022
79f8457
Merge branch 'master' into ci/move-to-github-actions
galargh Oct 20, 2022
b787b5e
Merge branch 'master' into ci/move-to-github-actions
galargh Nov 14, 2022
7ac1d8a
Update .github/workflows/sharness.yml
galargh Nov 14, 2022
d32d816
Apply suggestions from code review
galargh Nov 15, 2022
7db9ea7
ci: stop using deprecated set-output command
galargh Dec 5, 2022
7e85c5a
Apply suggestions from code review
galargh Dec 5, 2022
a5148ef
ci: split interop suites
galargh Dec 5, 2022
efec414
Merge branch 'master' into ci/move-to-github-actions
galargh Dec 5, 2022
680edf5
Merge branch 'master' into ci/move-to-github-actions
galargh Dec 5, 2022
eacac1a
Merge branch 'master' into ci/move-to-github-actions
lidel Jan 5, 2023
06dca5e
chore: rename prefix to ci/gh-experiment
lidel Jan 13, 2023
625eb77
chore: document how ipfs-webui tests work
lidel Jan 13, 2023
72c12c6
Merge branch 'master' into ci/move-to-github-actions
galargh Jan 13, 2023
65ca877
chore: run ipfs-webui build only once
lidel Jan 13, 2023
aa871a2
chore: make it clear how to find HTML Reports
lidel Jan 13, 2023
6d6e006
chore: docker-build - match circleci name
lidel Jan 13, 2023
0c11db6
chore: show failed sharness tests in job log
lidel Jan 13, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
executor: continuation/default
steps:
- checkout
- run:
- run:
name: Generate params
# for builds on the ipfs/kubo repo, use 2xlarge for faster builds
# but since this is not available for many contributors, we otherwise use medium
Expand Down
8 changes: 5 additions & 3 deletions .circleci/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,16 @@ jobs:
path: /tmp/circleci-test-results
sharness:
machine:
image: ubuntu-2004:202010-01
image: ubuntu-2204:2022.10.1
lidel marked this conversation as resolved.
Show resolved Hide resolved
resource_class: << pipeline.parameters.resource_class >>
working_directory: ~/ipfs/kubo
environment:
<<: *default_environment
TEST_NO_DOCKER: 0
TEST_NO_PLUGIN: 1
lidel marked this conversation as resolved.
Show resolved Hide resolved
TEST_NO_FUSE: 1
TEST_VERBOSE: 1
TEST_JUNIT: 1
steps:
- run: sudo apt update
- run: |
Expand All @@ -159,7 +161,7 @@ jobs:
tar xfz go1.19.1.linux-amd64.tar.gz
echo "export PATH=$(pwd)/go/bin:\$PATH" >> ~/.bashrc
- run: go version
- run: sudo apt install socat net-tools fish
- run: sudo apt install socat net-tools fish libxml2-utils
- checkout

- run:
Expand All @@ -183,7 +185,7 @@ jobs:
command: echo "export TEST_DOCKER_HOST=$(ip -4 addr show docker0 | grep -Po 'inet \K[\d.]+')" >> $BASH_ENV
- run:
echo TEST_DOCKER_HOST=$TEST_DOCKER_HOST &&
make -O -j << pipeline.parameters.make_jobs >> coverage/sharness_tests.coverprofile test/sharness/test-results/sharness.xml TEST_GENERATE_JUNIT=1 CONTINUE_ON_S_FAILURE=1 TEST_DOCKER_HOST=$TEST_DOCKER_HOST
make -O -j << pipeline.parameters.make_jobs >> test_sharness_expensive coverage/sharness_tests.coverprofile test/sharness/test-results/sharness.xml CONTINUE_ON_S_FAILURE=1 TEST_DOCKER_HOST=$TEST_DOCKER_HOST
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We were not running expensive tests before. The way the make file is written - https://github.com/ipfs/kubo/blob/master/test/sharness/Rules.mk#L46 - it seems the intention was to execute tests with TEST_EXPENSIVE=1 though.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack, tests flagged as expensive live in test/sharness/t0040-add-and-cat.sh:

$ rg EXPENSIVE test/sharness
test/sharness/t0040-add-and-cat.sh
588:  test_expect_success EXPENSIVE "generate 100MB file using go-random" '
592:  test_expect_success EXPENSIVE "sha1 of the file looks ok" '
598:  test_expect_success EXPENSIVE "ipfs add $ADD_FLAGS bigfile succeeds" '
602:  test_expect_success EXPENSIVE "ipfs add bigfile output looks good" '
607:  test_expect_success EXPENSIVE "ipfs cat succeeds" '
611:  test_expect_success EXPENSIVE "ipfs cat output looks good" '
616:  test_expect_success EXPENSIVE "ipfs cat output hashed looks good" '
621:  test_expect_success FUSE,EXPENSIVE "cat ipfs/bigfile succeeds" '
625:  test_expect_success FUSE,EXPENSIVE "cat ipfs/bigfile looks good" '

test/sharness/lib/test-lib.sh
95:test "$TEST_EXPENSIVE" = 1 && test_set_prereq EXPENSIVE
111:  echo '# TEST_EXPENSIVE='"$TEST_EXPENSIVE"

test/sharness/Rules.mk
69:test_sharness_expensive: export TEST_EXPENSIVE=1

They seem to add ~5 seconds to the runtime on my PC, I think that is ok.
But maybe remove the makefile magic and have explicit TEST_EXPENSIVE=1 in the workflow, like we do TEST_NO_PLUGIN?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done! I replaced test_sharness_expensive and test_sharness_short directives with a single test_sharness one. Now expensive sharness tests are controlled only via TEST_EXPENSIVE variable.

- run:
when: always
command: bash <(curl -s https://codecov.io/bash) -cF sharness -X search -f coverage/sharness_tests.coverprofile
Expand Down
189 changes: 189 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
name: '[EXPERIMENTAL] Interop'

on:
workflow_dispatch:
pull_request:
push:
branches:
- 'master'

jobs:
prepare:
if: github.repository == 'ipfs/kubo' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
env:
TEST_NO_DOCKER: 1
TEST_NO_FUSE: 1
TEST_VERBOSE: 1
TRAVIS: 1
GIT_PAGER: cat
IPFS_CHECK_RCMGR_DEFAULTS: 1
defaults:
run:
shell: bash
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.19.1
galargh marked this conversation as resolved.
Show resolved Hide resolved
- uses: actions/checkout@v3
- uses: protocol/cache-go-action@v1
with:
name: ${{ github.job }}
- run: make build
- uses: actions/upload-artifact@v3
with:
name: kubo
path: cmd/ipfs/ipfs
ipfs-interop:
needs: [prepare]
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- uses: actions/setup-node@v3
with:
node-version: 16.12.0
- uses: actions/download-artifact@v3
with:
name: kubo
path: cmd/ipfs
- run: chmod +x cmd/ipfs/ipfs
- run: |
echo "::set-output name=dir::$(npm config get cache)"
galargh marked this conversation as resolved.
Show resolved Hide resolved
id: npm-cache-dir
- uses: actions/cache@v3
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-${{ github.job }}-
- run: mkdir interop
- run: |
npm init -y
npm install ipfs@^0.61.0
npm install ipfs-interop@^8.0.10
working-directory: interop
- run: npx ipfs-interop -- -t node
env:
LIBP2P_TCP_REUSEPORT: false
LIBP2P_ALLOW_WEAK_RSA_KEYS: 1
IPFS_GO_EXEC: ${{ github.workspace }}/cmd/ipfs/ipfs
working-directory: interop
go-ipfs-api:
needs: [prepare]
runs-on: ubuntu-latest
env:
TEST_NO_DOCKER: 1
TEST_NO_FUSE: 1
TEST_VERBOSE: 1
TRAVIS: 1
GIT_PAGER: cat
IPFS_CHECK_RCMGR_DEFAULTS: 1
defaults:
run:
shell: bash
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.19.1
- uses: actions/download-artifact@v3
with:
name: kubo
path: cmd/ipfs
- run: chmod +x cmd/ipfs/ipfs
- uses: actions/checkout@v3
with:
repository: ipfs/go-ipfs-api
path: go-ipfs-api
- run: cmd/ipfs/ipfs daemon --init --enable-namesys-pubsub &
- run: |
while ! cmd/ipfs/ipfs id --api=/ip4/127.0.0.1/tcp/5001 2>/dev/null; do
sleep 1
done
timeout-minutes: 5
- uses: protocol/cache-go-action@v1
with:
name: ${{ github.job }}
- run: go test -count=1 -v ./...
working-directory: go-ipfs-api
- run: cmd/ipfs/ipfs shutdown
if: always()
go-ipfs-http-client:
needs: [prepare]
runs-on: ubuntu-latest
env:
TEST_NO_DOCKER: 1
TEST_NO_FUSE: 1
TEST_VERBOSE: 1
TRAVIS: 1
GIT_PAGER: cat
IPFS_CHECK_RCMGR_DEFAULTS: 1
defaults:
run:
shell: bash
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.19.1
- uses: actions/download-artifact@v3
with:
name: kubo
path: cmd/ipfs
- run: chmod +x cmd/ipfs/ipfs
- uses: actions/checkout@v3
with:
repository: ipfs/go-ipfs-http-client
path: go-ipfs-http-client
- uses: protocol/cache-go-action@v1
with:
name: ${{ github.job }}
- run: echo '${{ github.workspace }}/cmd/ipfs' >> $GITHUB_PATH
- run: go test -count=1 -v ./...
working-directory: go-ipfs-http-client
ipfs-webui:
needs: [prepare]
runs-on: ubuntu-latest
env:
NO_SANDBOX: true
LIBP2P_TCP_REUSEPORT: false
LIBP2P_ALLOW_WEAK_RSA_KEYS: 1
E2E_IPFSD_TYPE: go
TRAVIS: 1
GIT_PAGER: cat
IPFS_CHECK_RCMGR_DEFAULTS: 1
defaults:
run:
shell: bash
steps:
- uses: actions/setup-node@v3
with:
node-version: 16.12.0
- uses: actions/download-artifact@v3
with:
name: kubo
path: cmd/ipfs
- run: chmod +x cmd/ipfs/ipfs
- uses: actions/checkout@v3
with:
repository: ipfs/ipfs-webui
path: ipfs-webui
- run: |
echo "::set-output name=dir::$(npm config get cache)"
id: npm-cache-dir
- uses: actions/cache@v3
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-${{ github.job }}-
- run: |
npm ci --prefer-offline --no-audit --progress=false
npx playwright install
working-directory: ipfs-webui
- run: npm test
working-directory: ipfs-webui
- run: npm test
env:
IPFS_GO_EXEC: ${{ github.workspace }}/cmd/ipfs/ipfs
working-directory: ipfs-webui
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
name: "CodeQL"
name: CodeQL

on:
workflow_dispatch:
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: '[EXPERIMENTAL] Build Docker image'

on:
workflow_dispatch:
pull_request:
push:
branches:
- 'master'

jobs:
docker-build:
if: github.repository == 'ipfs/kubo' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
env:
IMAGE_NAME: ipfs/kubo
WIP_IMAGE_TAG: wip
defaults:
run:
shell: bash
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.19.1
- uses: actions/checkout@v3
- run: docker build -t $IMAGE_NAME:$WIP_IMAGE_TAG .
39 changes: 39 additions & 0 deletions .github/workflows/gobuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: '[EXPERIMENTAL] Go Build'

on:
workflow_dispatch:
pull_request:
push:
branches:
- 'master'

jobs:
runner:
if: github.repository == 'ipfs/kubo' || github.event_name == 'workflow_dispatch'
uses: ipfs/kubo/.github/workflows/runner.yml@ci/move-to-github-actions # TODO: change to master
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I'll change it in a subsequent PR. That way this one will be green when we merge it and master will be green after the merge.

gobuild:
needs: [runner]
runs-on: ${{ fromJSON(needs.runner.outputs.config).labels }}
env:
TEST_NO_DOCKER: 1
TEST_VERBOSE: 1
TRAVIS: 1
GIT_PAGER: cat
IPFS_CHECK_RCMGR_DEFAULTS: 1
defaults:
run:
shell: bash
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.19.1
- uses: actions/checkout@v3
- uses: protocol/cache-go-action@v1
with:
name: ${{ github.job }}
- run: make cmd/ipfs-try-build
env:
TEST_NO_FUSE: 0
- run: make cmd/ipfs-try-build
env:
TEST_NO_FUSE: 1
9 changes: 8 additions & 1 deletion .github/workflows/golang-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
on: [push, pull_request]
name: Go Checks

on:
workflow_dispatch:
pull_request:
push:
branches:
- 'master'

jobs:
unit:
if: github.repository == 'ipfs/kubo' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
name: All
steps:
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/golint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: '[EXPERIMENTAL] Go Lint'

on:
workflow_dispatch:
pull_request:
push:
branches:
- 'master'

jobs:
golint:
if: github.repository == 'ipfs/kubo' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
env:
TEST_NO_DOCKER: 1
TEST_NO_FUSE: 1
TEST_VERBOSE: 1
TRAVIS: 1
GIT_PAGER: cat
IPFS_CHECK_RCMGR_DEFAULTS: 1
defaults:
run:
shell: bash
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.19.1
- uses: actions/checkout@v3
- uses: protocol/cache-go-action@v1
with:
name: ${{ github.job }}
- run: make -O test_go_lint
Loading