Skip to content

Commit

Permalink
copy over github actions config
Browse files Browse the repository at this point in the history
  • Loading branch information
hayes-mysten committed Jan 8, 2025
1 parent d1ca9ad commit 3935501
Show file tree
Hide file tree
Showing 41 changed files with 439 additions and 31 deletions.
7 changes: 7 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Changesets

Hello and welcome! This folder was automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos to help version and publish code. You can
find the full documentation for it [in the changesets repository](https://github.com/changesets/changesets).

You can view a list of [common questions](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) to help you get started with changesets.
17 changes: 17 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "minor",
"privatePackages": false,
"ignore": [
"@mysten/sdk-docs"
],
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
"onlyUpdatePeerDependentsWhenOutOfRange": true
}
}
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
packages/ @MystenLabs/sdk-reviewers
packages/kiosk @MystenLabs/kiosk-sdk-reviewers
packages/wallet-standard @MystenLabs/wallet-kit-reviewers
35 changes: 35 additions & 0 deletions .github/ISSUE_TEMPLATE/code-bug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: Sui Code Bug
about: Create a new software bug for issues encountered running Sui
title: 'Sui Code Bug or Feature Request'
labels: bug
assignees: ''
---

## Steps to Reproduce Issue

Fill this in with the concrete steps needed to reproduce the bug. When providing code in the reproduction steps, use the smallest snippet of code that demonstrates the issue, removing any extraneous details.

e.g.

1. Call function <function call>.
2. Use return value and call <other function call>.

## Expected Result

Specify what outcome you expected should have resulted, but didn't.

e.g.
Expected <other function call> to return 42.

## Actual Result

Specify what the actual unexpected outcome was.

e.g.
<other function call> returned 41.

## Environment Information

- Runtime: <specify runtime (eg. [email protected] or [email protected])>
- Package manager: <specify package manager eg. [email protected]>
13 changes: 13 additions & 0 deletions .github/ISSUE_TEMPLATE/doc-bug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
name: Sui doc content issue or request
about: Creates an issue for Sui documentation
title: 'Sui doc content issue or request'
labels: doc-issue
assignees: 'ronny-mysten'
---

If this is an issue with existing content, provide the URL or GitHub path to the topic. Otherwise, use **New**.

Describe the issue or request. Provide as much detail as possible. For issues, it is helpful to copy the specific section of the topic into the issue.

Thank you for taking the time to let us know about the issue or request. We triage all new issues and requests within 2 business days. We will follow up if we need additional information.
9 changes: 9 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## Description

Describe the changes or additions included in this PR.

## Test plan

How did you test the new or updated feature?

---
85 changes: 85 additions & 0 deletions .github/workflows/changesets-ci-comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Changesets CI Comment

# NOTE: This workflow run indirection is used to securely comment on PRs when
# changeset CI runs are completed.
on:
workflow_run:
workflows: ["Changesets CI"]
types:
- completed

jobs:
upload:
runs-on: ubuntu-latest
if: >
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success'
steps:
- name: Get workflow run information
uses: potiuk/get-workflow-origin@e3ba776faee1134e17551924b852bfb374e1703d # pin@v1_1
id: source-run-info
with:
token: ${{ secrets.GITHUB_TOKEN }}
sourceRunId: ${{ github.event.workflow_run.id }}

- name: "Download artifact"
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # [email protected]
id: get-artifact
if: steps.source-run-info.outputs.pullRequestNumber
with:
result-encoding: string
script: |
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id,
});
let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {
return artifact.name == "missing-changeset"
})[0];
if (!matchArtifact) {
return 'false';
}
return 'true';
- name: Comment PR
uses: thollander/actions-comment-pull-request@dadb7667129e23f12ca3925c90dc5cd7121ab57e # pin@v2
if: steps.get-artifact.outputs.result == 'true' && steps.source-run-info.outputs.pullRequestNumber
with:
pr_number: ${{ steps.source-run-info.outputs.pullRequestNumber }}
comment_tag: "changesets-warning"
message: |
⚠️ 🦋 **Changesets Warning:** This PR has changes to public npm packages, but does not contain a changeset. You can create a changeset easily by running `pnpm changeset` in the root of the Sui repo, and following the prompts. If your change does not need a changeset (e.g. a documentation-only change), you can ignore this message. This warning will be removed when a changeset is added to this pull request.
[Learn more about Changesets](https://github.com/changesets/changesets).
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Remove outdated comments
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # [email protected]
if: steps.get-artifact.outputs.result == 'false' && steps.source-run-info.outputs.pullRequestNumber
env:
ISSUE_NUMBER: ${{ steps.source-run-info.outputs.pullRequestNumber }}
with:
script: |
const resp = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: process.env.ISSUE_NUMBER
});
const comments = resp.data.filter(it => it.body.startsWith('⚠️ 🦋 **Changesets Warning:**'));
for (const comment of comments) {
console.log(
`Removing issue ${comment.issue_url}`
);
await github.rest.issues.deleteComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: comment.id
});
}
43 changes: 43 additions & 0 deletions .github/workflows/changesets-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Changesets CI
on: pull_request
jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: checkout code repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1
with:
fetch-depth: 0
- uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # [email protected]
with:
version: 9.1.1
- name: Install Nodejs
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # [email protected]
with:
node-version: '18'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- id: diff
name: Determine changed public packages from previous commit
run: echo "hasChanges=$(pnpm list --filter "...[$(git rev-parse HEAD^1)]" --depth -1 --json | jq "any(.[] | select(.private != true) ; length > 0)")" >> $GITHUB_OUTPUT
- name: Get changed files in the changesets folder
id: has-changesets
uses: tj-actions/changed-files@0874344d6ebbaa00a27da73276ae7162fadcaf69 # [email protected]
with:
files: |
.changeset/**
- name: Create missing changeset note if there are missing changesets
if: steps.has-changesets.outputs.any_changed != 'true' && steps.diff.outputs.hasChanges == 'true'
run: |
echo "true" > missing-changeset.txt
- name: Upload missing changeset artifact
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # [email protected]
if: steps.has-changesets.outputs.any_changed != 'true' && steps.diff.outputs.hasChanges == 'true'
with:
name: missing-changeset
path: missing-changeset.txt
if-no-files-found: error
retention-days: 1
- name: Attempt to create snapshots.
run: pnpm changeset version --snapshot test-do-not-publish
55 changes: 55 additions & 0 deletions .github/workflows/changesets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Changesets
on:
## Allow triggering this workflow manually via GitHub CLI/web
workflow_dispatch:
push:
branches:
- main

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Dispatch Changesets To Operations
uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # [email protected]
with:
repository: MystenLabs/sui-operations
token: ${{ secrets.CHANGESETS_DEPLOY_DISPATCH }}
event-type: changesets
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'

version:
runs-on: ubuntu-latest
steps:
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # pin@v1
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}

- name: checkout code repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1
with:
token: ${{ steps.generate_token.outputs.token }}
fetch-depth: 0
- uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # [email protected]
with:
version: 9.1.1
- name: Install Nodejs
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # [email protected]
with:
node-version: '18'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Create Release Pull Request
uses: changesets/action@f13b1baaa620fde937751f5d2c3572b9da32af23 # pin@v1
with:
# Generates src/version.ts file using genVersion
# https://github.com/changesets/action#with-version-script
version: pnpm changeset-version
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
40 changes: 40 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: End-to-end Tests
on: pull_request
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
# Run e2e test against localnet built on the testnet branch
localnet:
name: Localnet
runs-on: ubuntu-ghcloud
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
name: Install pnpm
with:
run_install: false

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Run TS SDK e2e tests
run: pnpm --filter @mysten/sui test:e2e

- name: Run RPC/GraphQL compatibility e2e tests
run: pnpm --filter @mysten/graphql-transport test:e2e

- name: Run kiosk sdk e2e tests
run: pnpm --filter @mysten/kiosk test:e2e

- name: Run suins-toolkit sdk e2e tests
run: pnpm --filter @mysten/suins-toolkit test:e2e
shell: bash
Loading

0 comments on commit 3935501

Please sign in to comment.