Skip to content

Commit

Permalink
Merge pull request #9936 from ipfs/release-v0.21.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hacdias authored Jun 12, 2023
2 parents b8c4725 + 696b3a4 commit 85c53ab
Show file tree
Hide file tree
Showing 123 changed files with 5,785 additions and 2,361 deletions.
4 changes: 4 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<!--
PR Creation Checklist
- [ ] Update Changelog
-->
71 changes: 28 additions & 43 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,23 @@ name: Interop
on:
workflow_dispatch:
pull_request:
paths-ignore:
- '**/*.md'
push:
branches:
- 'master'

env:
GO_VERSION: 1.19.1
GO_VERSION: 1.19.x

concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event_name == 'push' && github.sha || github.ref }}
cancel-in-progress: true

defaults:
run:
shell: bash

jobs:
interop-prep:
if: github.repository == 'ipfs/kubo' || github.event_name == 'workflow_dispatch'
Expand Down Expand Up @@ -44,7 +50,7 @@ jobs:
path: cmd/ipfs/ipfs
interop:
needs: [interop-prep]
runs-on: ubuntu-latest
runs-on: ${{ fromJSON(github.repository == 'ipfs/kubo' && '["self-hosted", "linux", "x64", "2xlarge"]' || '"ubuntu-latest"') }}
timeout-minutes: 20
defaults:
run:
Expand Down Expand Up @@ -75,7 +81,7 @@ jobs:
npm install ipfs-interop@^10.0.1
working-directory: interop
# Run the interop tests while ignoring the js-js interop test cases
- run: npx ipfs-interop -- -t node --grep '^(?!.*(js\d? -> js\d?|js-js-js))'
- run: npx ipfs-interop -- -t node --grep '^(?!.*(js\d? -> js\d?|js-js-js))' --parallel
env:
LIBP2P_TCP_REUSEPORT: false
LIBP2P_ALLOW_WEAK_RSA_KEYS: 1
Expand Down Expand Up @@ -121,42 +127,9 @@ jobs:
working-directory: go-ipfs-api
- run: cmd/ipfs/ipfs shutdown
if: always()
go-ipfs-http-client:
needs: [interop-prep]
runs-on: ubuntu-latest
timeout-minutes: 5
env:
TEST_DOCKER: 0
TEST_FUSE: 0
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: ${{ env.GO_VERSION }}
- 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: [interop-prep]
runs-on: ubuntu-latest
runs-on: ${{ fromJSON(github.repository == 'ipfs/kubo' && '["self-hosted", "linux", "x64", "2xlarge"]' || '"ubuntu-latest"') }}
timeout-minutes: 20
env:
NO_SANDBOX: true
Expand Down Expand Up @@ -191,14 +164,26 @@ jobs:
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
- env:
NPM_CACHE_DIR: ${{ steps.npm-cache-dir.outputs.dir }}
run: |
npm ci --prefer-offline --no-audit --progress=false --cache "$NPM_CACHE_DIR"
npx playwright install --with-deps
working-directory: ipfs-webui
- name: Run ipfs-webui@main build and smoke-test to confirm the upstream repo is not broken
run: npm test
- id: ref
run: echo "ref=$(git rev-parse --short HEAD)" | tee -a $GITHUB_OUTPUT
working-directory: ipfs-webui
- id: state
env:
GITHUB_REPOSITORY: ipfs/ipfs-webui
GITHUB_REF: ${{ steps.ref.outputs.ref }}
GITHUB_TOKEN: ${{ github.token }}
run: |
echo "state=$(curl -L -H "Authorization: Bearer $GITHUB_TOKEN" "https://api.github.com/repos/$GITHUB_REPOSITORY/commits/$GITHUB_REF/status" --jq '.state')" | tee -a $GITHUB_OUTPUT
- name: Build ipfs-webui@main (state=${{ steps.state.outputs.state }})
run: npm run test:build
working-directory: ipfs-webui
- name: Test ipfs-webui@main E2E against the locally built Kubo binary
- name: Test ipfs-webui@main (state=${{ steps.state.outputs.state }}) E2E against the locally built Kubo binary
run: npm run test:e2e
env:
IPFS_GO_EXEC: ${{ github.workspace }}/cmd/ipfs/ipfs
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
paths-ignore:
- '**/*.md'
schedule:
- cron: '30 12 * * 2'

Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: Docker Build
on:
workflow_dispatch:
pull_request:
paths-ignore:
- '**/*.md'
push:
branches:
- 'master'
Expand All @@ -25,6 +27,6 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.19.1
go-version: 1.19.x
- uses: actions/checkout@v3
- run: docker build -t $IMAGE_NAME:$WIP_IMAGE_TAG .
38 changes: 30 additions & 8 deletions .github/workflows/gateway-conformance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
branches:
- master
pull_request:
paths-ignore:
- '**/*.md'

concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event_name == 'push' && github.sha || github.ref }}
Expand All @@ -21,7 +23,7 @@ jobs:
steps:
# 1. Download the gateway-conformance fixtures
- name: Download gateway-conformance fixtures
uses: ipfs/gateway-conformance/.github/actions/extract-fixtures@v0.0
uses: ipfs/gateway-conformance/.github/actions/extract-fixtures@v0.1
with:
output: fixtures

Expand All @@ -38,8 +40,8 @@ jobs:
run: make build
working-directory: kubo-gateway

# 3. Start the kubo-gateway
- name: Start kubo-gateway
# 3. Init the kubo-gateway
- name: Init kubo-gateway
env:
GATEWAY_PUBLIC_GATEWAYS: |
{
Expand All @@ -56,16 +58,36 @@ jobs:
run: |
./ipfs init
./ipfs config --json Gateway.PublicGateways "$GATEWAY_PUBLIC_GATEWAYS"
./ipfs daemon --offline &
working-directory: kubo-gateway/cmd/ipfs

# 4. Populate the Kubo gateway with the gateway-conformance fixtures
- name: Import fixtures
run: find ./fixtures -name '*.car' -exec kubo-gateway/cmd/ipfs/ipfs dag import --pin-roots=false {} \;
run: |
# Import car files
find ./fixtures -name '*.car' -exec kubo-gateway/cmd/ipfs/ipfs dag import --pin-roots=false {} \;
# Import ipns records
records=$(find ./fixtures -name '*.ipns-record')
for record in $records
do
key=$(basename -s .ipns-record "$record" | cut -d'_' -f1)
kubo-gateway/cmd/ipfs/ipfs routing put --allow-offline "/ipns/$key" "$record"
done
# Import dnslink records
# the IPFS_NS_MAP env will be used by the daemon
export IPFS_NS_MAP=$(cat ./fixtures/dnslinks.json | jq -r 'to_entries | map("\(.key).example.com:\(.value)") | join(",")')
echo "IPFS_NS_MAP=${IPFS_NS_MAP}" >> $GITHUB_ENV
# 5. Start the kubo-gateway
- name: Start kubo-gateway
run: |
./ipfs daemon --offline &
working-directory: kubo-gateway/cmd/ipfs

# 5. Run the gateway-conformance tests
# 6. Run the gateway-conformance tests
- name: Run gateway-conformance tests
uses: ipfs/gateway-conformance/.github/actions/test@v0.0
uses: ipfs/gateway-conformance/.github/actions/test@v0.1
with:
gateway-url: http://127.0.0.1:8080
json: output.json
Expand All @@ -74,7 +96,7 @@ jobs:
markdown: output.md
args: -skip 'TestGatewayCar/GET_response_for_application/vnd.ipld.car/Header_Content-Length'

# 6. Upload the results
# 7. Upload the results
- name: Upload MD summary
if: failure() || success()
run: cat output.md >> $GITHUB_STEP_SUMMARY
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/gobuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: Go Build
on:
workflow_dispatch:
pull_request:
paths-ignore:
- '**/*.md'
push:
branches:
- 'master'
Expand All @@ -12,12 +14,9 @@ concurrency:
cancel-in-progress: true

jobs:
go-build-runner:
if: github.repository == 'ipfs/kubo' || github.event_name == 'workflow_dispatch'
uses: ipfs/kubo/.github/workflows/runner.yml@master
go-build:
needs: [go-build-runner]
runs-on: ${{ fromJSON(needs.go-build-runner.outputs.config).labels }}
if: github.repository == 'ipfs/kubo' || github.event_name == 'workflow_dispatch'
runs-on: ${{ fromJSON(github.repository == 'ipfs/kubo' && '["self-hosted", "linux", "x64", "4xlarge"]' || '"ubuntu-latest"') }}
timeout-minutes: 20
env:
TEST_DOCKER: 0
Expand All @@ -31,7 +30,7 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.19.1
go-version: 1.19.x
- uses: actions/checkout@v3
- uses: protocol/cache-go-action@v1
with:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/golang-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: Go Check
on:
workflow_dispatch:
pull_request:
paths-ignore:
- '**/*.md'
push:
branches:
- 'master'
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/golint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: Go Lint
on:
workflow_dispatch:
pull_request:
paths-ignore:
- '**/*.md'
push:
branches:
- 'master'
Expand All @@ -29,7 +31,7 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.19.1
go-version: 1.19.x
- uses: actions/checkout@v3
- uses: protocol/cache-go-action@v1
with:
Expand Down
16 changes: 9 additions & 7 deletions .github/workflows/gotest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: Go Test
on:
workflow_dispatch:
pull_request:
paths-ignore:
- '**/*.md'
push:
branches:
- 'master'
Expand All @@ -12,12 +14,9 @@ concurrency:
cancel-in-progress: true

jobs:
go-test-runner:
if: github.repository == 'ipfs/kubo' || github.event_name == 'workflow_dispatch'
uses: ipfs/kubo/.github/workflows/runner.yml@master
go-test:
needs: [go-test-runner]
runs-on: ${{ fromJSON(needs.go-test-runner.outputs.config).labels }}
if: github.repository == 'ipfs/kubo' || github.event_name == 'workflow_dispatch'
runs-on: ${{ fromJSON(github.repository == 'ipfs/kubo' && '["self-hosted", "linux", "x64", "2xlarge"]' || '"ubuntu-latest"') }}
timeout-minutes: 20
env:
TEST_DOCKER: 0
Expand All @@ -33,16 +32,19 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19.1
go-version: 1.19.x
- name: Check out Kubo
uses: actions/checkout@v3
- name: Restore Go cache
uses: protocol/cache-go-action@v1
with:
name: ${{ github.job }}
- name: 👉️ If this step failed, go to «Summary» (top left) → inspect the «Failures/Errors» table
env:
# increasing parallelism beyond 2 doesn't speed up the tests much
PARALLEL: 2
run: |
make -j 2 test/unit/gotest.junit.xml &&
make -j "$PARALLEL" test/unit/gotest.junit.xml &&
[[ ! $(jq -s -c 'map(select(.Action == "fail")) | .[]' test/unit/gotest.json) ]]
- name: Upload coverage to Codecov
uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0
Expand Down
34 changes: 0 additions & 34 deletions .github/workflows/runner.yml

This file was deleted.

Loading

0 comments on commit 85c53ab

Please sign in to comment.