|
| 1 | +name: 'ci/gh-experiment: interop' |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + pull_request: |
| 6 | + push: |
| 7 | + branches: |
| 8 | + - 'master' |
| 9 | + |
| 10 | +env: |
| 11 | + GO_VERSION: 1.19.1 |
| 12 | + |
| 13 | +jobs: |
| 14 | + prepare: |
| 15 | + if: github.repository == 'ipfs/kubo' || github.event_name == 'workflow_dispatch' |
| 16 | + runs-on: ubuntu-latest |
| 17 | + env: |
| 18 | + TEST_NO_DOCKER: 1 |
| 19 | + TEST_NO_FUSE: 1 |
| 20 | + TEST_VERBOSE: 1 |
| 21 | + TRAVIS: 1 |
| 22 | + GIT_PAGER: cat |
| 23 | + IPFS_CHECK_RCMGR_DEFAULTS: 1 |
| 24 | + defaults: |
| 25 | + run: |
| 26 | + shell: bash |
| 27 | + steps: |
| 28 | + - uses: actions/setup-go@v3 |
| 29 | + with: |
| 30 | + go-version: ${{ env.GO_VERSION }} |
| 31 | + - uses: actions/checkout@v3 |
| 32 | + - uses: protocol/cache-go-action@v1 |
| 33 | + with: |
| 34 | + name: ${{ github.job }} |
| 35 | + - run: make build |
| 36 | + - uses: actions/upload-artifact@v3 |
| 37 | + with: |
| 38 | + name: kubo |
| 39 | + path: cmd/ipfs/ipfs |
| 40 | + ipfs-interop: |
| 41 | + needs: [prepare] |
| 42 | + runs-on: ubuntu-latest |
| 43 | + strategy: |
| 44 | + matrix: |
| 45 | + suites: |
| 46 | + - 'exchange-files' |
| 47 | + - 'files pin circuit ipns cid-version-agnostic ipns-pubsub pubsub' |
| 48 | + fail-fast: false |
| 49 | + defaults: |
| 50 | + run: |
| 51 | + shell: bash |
| 52 | + steps: |
| 53 | + - uses: actions/setup-node@v3 |
| 54 | + with: |
| 55 | + node-version: 16.12.0 |
| 56 | + - uses: actions/download-artifact@v3 |
| 57 | + with: |
| 58 | + name: kubo |
| 59 | + path: cmd/ipfs |
| 60 | + - run: chmod +x cmd/ipfs/ipfs |
| 61 | + - run: | |
| 62 | + echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT |
| 63 | + id: npm-cache-dir |
| 64 | + - uses: actions/cache@v3 |
| 65 | + with: |
| 66 | + path: ${{ steps.npm-cache-dir.outputs.dir }} |
| 67 | + key: ${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/package-lock.json') }} |
| 68 | + restore-keys: | |
| 69 | + ${{ runner.os }}-${{ github.job }}- |
| 70 | + - run: mkdir interop |
| 71 | + - run: | |
| 72 | + npm init -y |
| 73 | + npm install ipfs@^0.61.0 |
| 74 | + npm install ipfs-interop@^8.0.10 |
| 75 | + working-directory: interop |
| 76 | + - run: npx ipfs-interop -- -t node $(sed -e 's#[^ ]*#-f test/&.js#g' <<< '${{ matrix.suites }}') |
| 77 | + env: |
| 78 | + LIBP2P_TCP_REUSEPORT: false |
| 79 | + LIBP2P_ALLOW_WEAK_RSA_KEYS: 1 |
| 80 | + IPFS_GO_EXEC: ${{ github.workspace }}/cmd/ipfs/ipfs |
| 81 | + working-directory: interop |
| 82 | + go-ipfs-api: |
| 83 | + needs: [prepare] |
| 84 | + runs-on: ubuntu-latest |
| 85 | + env: |
| 86 | + TEST_NO_DOCKER: 1 |
| 87 | + TEST_NO_FUSE: 1 |
| 88 | + TEST_VERBOSE: 1 |
| 89 | + TRAVIS: 1 |
| 90 | + GIT_PAGER: cat |
| 91 | + IPFS_CHECK_RCMGR_DEFAULTS: 1 |
| 92 | + defaults: |
| 93 | + run: |
| 94 | + shell: bash |
| 95 | + steps: |
| 96 | + - uses: actions/setup-go@v3 |
| 97 | + with: |
| 98 | + go-version: ${{ env.GO_VERSION }} |
| 99 | + - uses: actions/download-artifact@v3 |
| 100 | + with: |
| 101 | + name: kubo |
| 102 | + path: cmd/ipfs |
| 103 | + - run: chmod +x cmd/ipfs/ipfs |
| 104 | + - uses: actions/checkout@v3 |
| 105 | + with: |
| 106 | + repository: ipfs/go-ipfs-api |
| 107 | + path: go-ipfs-api |
| 108 | + - run: cmd/ipfs/ipfs daemon --init --enable-namesys-pubsub & |
| 109 | + - run: | |
| 110 | + while ! cmd/ipfs/ipfs id --api=/ip4/127.0.0.1/tcp/5001 2>/dev/null; do |
| 111 | + sleep 1 |
| 112 | + done |
| 113 | + timeout-minutes: 5 |
| 114 | + - uses: protocol/cache-go-action@v1 |
| 115 | + with: |
| 116 | + name: ${{ github.job }} |
| 117 | + - run: go test -count=1 -v ./... |
| 118 | + working-directory: go-ipfs-api |
| 119 | + - run: cmd/ipfs/ipfs shutdown |
| 120 | + if: always() |
| 121 | + go-ipfs-http-client: |
| 122 | + needs: [prepare] |
| 123 | + runs-on: ubuntu-latest |
| 124 | + env: |
| 125 | + TEST_NO_DOCKER: 1 |
| 126 | + TEST_NO_FUSE: 1 |
| 127 | + TEST_VERBOSE: 1 |
| 128 | + TRAVIS: 1 |
| 129 | + GIT_PAGER: cat |
| 130 | + IPFS_CHECK_RCMGR_DEFAULTS: 1 |
| 131 | + defaults: |
| 132 | + run: |
| 133 | + shell: bash |
| 134 | + steps: |
| 135 | + - uses: actions/setup-go@v3 |
| 136 | + with: |
| 137 | + go-version: ${{ env.GO_VERSION }} |
| 138 | + - uses: actions/download-artifact@v3 |
| 139 | + with: |
| 140 | + name: kubo |
| 141 | + path: cmd/ipfs |
| 142 | + - run: chmod +x cmd/ipfs/ipfs |
| 143 | + - uses: actions/checkout@v3 |
| 144 | + with: |
| 145 | + repository: ipfs/go-ipfs-http-client |
| 146 | + path: go-ipfs-http-client |
| 147 | + - uses: protocol/cache-go-action@v1 |
| 148 | + with: |
| 149 | + name: ${{ github.job }} |
| 150 | + - run: echo '${{ github.workspace }}/cmd/ipfs' >> $GITHUB_PATH |
| 151 | + - run: go test -count=1 -v ./... |
| 152 | + working-directory: go-ipfs-http-client |
| 153 | + ipfs-webui: |
| 154 | + needs: [prepare] |
| 155 | + runs-on: ubuntu-latest |
| 156 | + env: |
| 157 | + NO_SANDBOX: true |
| 158 | + LIBP2P_TCP_REUSEPORT: false |
| 159 | + LIBP2P_ALLOW_WEAK_RSA_KEYS: 1 |
| 160 | + E2E_IPFSD_TYPE: go |
| 161 | + TRAVIS: 1 |
| 162 | + GIT_PAGER: cat |
| 163 | + IPFS_CHECK_RCMGR_DEFAULTS: 1 |
| 164 | + defaults: |
| 165 | + run: |
| 166 | + shell: bash |
| 167 | + steps: |
| 168 | + - uses: actions/setup-node@v3 |
| 169 | + with: |
| 170 | + node-version: 16.12.0 |
| 171 | + - uses: actions/download-artifact@v3 |
| 172 | + with: |
| 173 | + name: kubo |
| 174 | + path: cmd/ipfs |
| 175 | + - run: chmod +x cmd/ipfs/ipfs |
| 176 | + - uses: actions/checkout@v3 |
| 177 | + with: |
| 178 | + repository: ipfs/ipfs-webui |
| 179 | + path: ipfs-webui |
| 180 | + - run: | |
| 181 | + echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT |
| 182 | + id: npm-cache-dir |
| 183 | + - uses: actions/cache@v3 |
| 184 | + with: |
| 185 | + path: ${{ steps.npm-cache-dir.outputs.dir }} |
| 186 | + key: ${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/package-lock.json') }} |
| 187 | + restore-keys: | |
| 188 | + ${{ runner.os }}-${{ github.job }}- |
| 189 | + - run: | |
| 190 | + npm ci --prefer-offline --no-audit --progress=false |
| 191 | + npx playwright install |
| 192 | + working-directory: ipfs-webui |
| 193 | + - name: Run ipfs-webui@main build and smoke-test to confirm the upstream repo is not broken |
| 194 | + run: npm test |
| 195 | + working-directory: ipfs-webui |
| 196 | + - name: Test ipfs-webui@main E2E against the locally built Kubo binary |
| 197 | + run: npm run test:e2e |
| 198 | + env: |
| 199 | + IPFS_GO_EXEC: ${{ github.workspace }}/cmd/ipfs/ipfs |
| 200 | + working-directory: ipfs-webui |
0 commit comments