This repository has been archived by the owner on Oct 30, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 8bc0ae9
Showing
15 changed files
with
777 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import EchoServer from 'aegir/echo-server' | ||
import body from 'body-parser' | ||
|
||
export default { | ||
test: { | ||
before: async () => { | ||
const providers = new Map() | ||
const echoServer = new EchoServer() | ||
echoServer.polka.use(body.text()) | ||
echoServer.polka.post('/add-providers/:cid', (req, res) => { | ||
providers.set(req.params.cid, req.body) | ||
res.end() | ||
}) | ||
echoServer.polka.get('/cid/:cid', (req, res) => { | ||
const provs = providers.get(req.params.cid) ?? '[]' | ||
providers.delete(req.params.cid) | ||
|
||
res.end(provs) | ||
}) | ||
|
||
await echoServer.start() | ||
|
||
return { | ||
env: { | ||
ECHO_SERVER: `http://${echoServer.host}:${echoServer.port}` | ||
}, | ||
echoServer | ||
} | ||
}, | ||
after: async (options, beforeResult) => { | ||
await beforeResult.echoServer.stop() | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: npm | ||
directory: "/" | ||
schedule: | ||
interval: daily | ||
time: "10:00" | ||
open-pull-requests-limit: 10 | ||
commit-message: | ||
prefix: "deps" | ||
prefix-development: "deps(dev)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
name: Automerge | ||
on: [ pull_request ] | ||
|
||
jobs: | ||
automerge: | ||
uses: protocol/.github/.github/workflows/automerge.yml@master | ||
with: | ||
job: 'automerge' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,181 @@ | ||
name: test & maybe release | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
|
||
check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: lts/* | ||
- uses: ipfs/aegir/actions/cache-node-modules@master | ||
- run: npm run --if-present lint | ||
- run: npm run --if-present dep-check | ||
|
||
test-node: | ||
needs: check | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [windows-latest, ubuntu-latest, macos-latest] | ||
node: [lts/*] | ||
fail-fast: true | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
- uses: ipfs/aegir/actions/cache-node-modules@master | ||
- run: npm run --if-present test:node | ||
- uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1 | ||
with: | ||
flags: node | ||
|
||
test-chrome: | ||
needs: check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: lts/* | ||
- uses: ipfs/aegir/actions/cache-node-modules@master | ||
- run: npm run --if-present test:chrome | ||
- uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1 | ||
with: | ||
flags: chrome | ||
|
||
test-chrome-webworker: | ||
needs: check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: lts/* | ||
- uses: ipfs/aegir/actions/cache-node-modules@master | ||
- run: npm run --if-present test:chrome-webworker | ||
- uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1 | ||
with: | ||
flags: chrome-webworker | ||
|
||
test-firefox: | ||
needs: check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: lts/* | ||
- uses: ipfs/aegir/actions/cache-node-modules@master | ||
- run: npm run --if-present test:firefox | ||
- uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1 | ||
with: | ||
flags: firefox | ||
|
||
test-firefox-webworker: | ||
needs: check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: lts/* | ||
- uses: ipfs/aegir/actions/cache-node-modules@master | ||
- run: npm run --if-present test:firefox-webworker | ||
- uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1 | ||
with: | ||
flags: firefox-webworker | ||
|
||
test-webkit: | ||
needs: check | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] | ||
node: [lts/*] | ||
fail-fast: true | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: lts/* | ||
- uses: ipfs/aegir/actions/cache-node-modules@master | ||
- run: npm run --if-present test:webkit | ||
- uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1 | ||
with: | ||
flags: webkit | ||
|
||
test-webkit-webworker: | ||
needs: check | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] | ||
node: [lts/*] | ||
fail-fast: true | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: lts/* | ||
- uses: ipfs/aegir/actions/cache-node-modules@master | ||
- run: npm run --if-present test:webkit-webworker | ||
- uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1 | ||
with: | ||
flags: webkit-webworker | ||
|
||
test-electron-main: | ||
needs: check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: lts/* | ||
- uses: ipfs/aegir/actions/cache-node-modules@master | ||
- run: npx xvfb-maybe npm run --if-present test:electron-main | ||
- uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1 | ||
with: | ||
flags: electron-main | ||
|
||
test-electron-renderer: | ||
needs: check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: lts/* | ||
- uses: ipfs/aegir/actions/cache-node-modules@master | ||
- run: npx xvfb-maybe npm run --if-present test:electron-renderer | ||
- uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1 | ||
with: | ||
flags: electron-renderer | ||
|
||
release: | ||
needs: [test-node, test-chrome, test-chrome-webworker, test-firefox, test-firefox-webworker, test-webkit, test-webkit-webworker, test-electron-main, test-electron-renderer] | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: lts/* | ||
- uses: ipfs/aegir/actions/cache-node-modules@master | ||
- uses: ipfs/aegir/actions/docker-login@master | ||
with: | ||
docker-token: ${{ secrets.DOCKER_TOKEN }} | ||
docker-username: ${{ secrets.DOCKER_USERNAME }} | ||
- run: npm run --if-present release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.UCI_GITHUB_TOKEN || github.token }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: "Semantic PR" | ||
|
||
on: | ||
pull_request_target: | ||
types: | ||
- opened | ||
- edited | ||
- synchronize | ||
|
||
jobs: | ||
main: | ||
name: Validate PR title | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: amannn/action-semantic-pull-request@b6bca70dcd3e56e896605356ce09b76f7e1e0d39 # v5.1.0 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
# Configure which types are allowed (newline delimited). | ||
types: | | ||
feat | ||
fix | ||
chore | ||
docs | ||
deps | ||
test | ||
refactor | ||
ci | ||
requireScope: false | ||
|
||
- name: Check PR title length | ||
env: | ||
TITLE: ${{ github.event.pull_request.title }} | ||
run: | | ||
title_length=${#TITLE} | ||
if [ $title_length -gt 72 ] | ||
then | ||
echo "PR title is too long (greater than 72 characters)" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Close and mark stale issue | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0 * * *' | ||
|
||
jobs: | ||
stale: | ||
|
||
runs-on: ubuntu-latest | ||
permissions: | ||
issues: write | ||
pull-requests: write | ||
|
||
steps: | ||
- uses: actions/stale@v3 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
stale-issue-message: 'Oops, seems like we needed more information for this issue, please comment with more details or this issue will be closed in 7 days.' | ||
close-issue-message: 'This issue was closed because it is missing author input.' | ||
stale-issue-label: 'kind/stale' | ||
any-of-labels: 'need/author-input' | ||
exempt-issue-labels: 'need/triage,need/community-input,need/maintainer-input,need/maintainers-input,need/analysis,status/blocked,status/in-progress,status/ready,status/deferred,status/inactive' | ||
days-before-issue-stale: 6 | ||
days-before-issue-close: 7 | ||
enable-statistics: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
node_modules | ||
build | ||
dist | ||
.docs | ||
.coverage | ||
node_modules | ||
package-lock.json | ||
yarn.lock | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
This project is dual licensed under MIT and Apache-2.0. | ||
|
||
MIT: https://www.opensource.org/licenses/mit | ||
Apache-2.0: https://www.apache.org/licenses/license-2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
The MIT License (MIT) | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
Oops, something went wrong.