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

Setup develop #1626

Draft
wants to merge 6 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 3 additions & 4 deletions .github/workflows/cargo-deny-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ on:
push:
branches:
- main
- develop
pull_request:
workflow_dispatch:

jobs:
cargo-deny:
runs-on: warp-ubuntu-latest-x64-16x
Expand All @@ -16,12 +16,11 @@ jobs:
- bans
- licenses
- sources

steps:
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v2
with:
command: check ${{ matrix.checks }}

# Prevent sudden announcement of a new advisory from failing CI
continue-on-error: ${{ matrix.checks == 'advisories' }}
continue-on-error: ${{ matrix.checks == 'advisories' }}

12 changes: 1 addition & 11 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
name: Deploy Docs to GitHub Pages

on:
push:
branches:
- main

- develop
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "github-pages"
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -27,26 +23,20 @@ jobs:
uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup Pages
uses: actions/configure-pages@v5

- name: Update rust toolchains
run: rustup update

- name: Cache
uses: Swatinem/rust-cache@v2
with:
workspaces: |
.

- name: Invoke cargo doc
run: ./dev/docs
id: docgen

- name: Upload pages artifact
uses: actions/upload-pages-artifact@v3

# Deployment job
deploy:
environment:
Expand Down
13 changes: 3 additions & 10 deletions .github/workflows/deploy-validation-server.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
name: Deploy Validation Service Image

on:
push:
branches:
- main

workflow_dispatch:

jobs:
push_to_registry:
name: Push Docker Image to GitHub Packages
Expand All @@ -19,20 +16,17 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Log in to the container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/mls-validation-service

- name: Build and push Docker image
uses: docker/build-push-action@v6
id: push
Expand All @@ -42,18 +36,16 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

deploy:
name: Deploy new images to infra
runs-on: warp-ubuntu-latest-x64-16x
needs: push_to_registry
strategy:
matrix:
environment: [ dev, production, testnet-staging ]
environment: [dev, production, testnet-staging]
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Deploy to ${{ matrix.environment }}
uses: xmtp-labs/terraform-deployer@v1
with:
Expand All @@ -62,4 +54,5 @@ jobs:
terraform-workspace: ${{ matrix.environment }}
variable-name: validation_service_image
variable-value: "ghcr.io/xmtp/mls-validation-service@${{ needs.push_to_registry.outputs.digest }}"
variable-value-required-prefix: "ghcr.io/xmtp/mls-validation-service@sha256:"
variable-value-required-prefix: "ghcr.io/xmtp/mls-validation-service@sha256:"

1 change: 1 addition & 0 deletions .github/workflows/lint-toml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
branches:
- main
- develop
pull_request:
paths:
- "**/*.toml"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/lint-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
branches:
- main
- develop
pull_request:
paths:
- ".github/workflows/lint-workspace.yaml"
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/nightly-protos.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Nightly Automation
on:
schedule:
- cron: '0 10 * * 1'
- cron: '0 10 * * 1'
workflow_dispatch:
jobs:
nightly-protos:
Expand All @@ -11,14 +11,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: develop
- uses: bufbuild/[email protected]
- name: Update rust toolchains
run: rustup update
- name: Cache
uses: Swatinem/rust-cache@v2
with:
workspaces: |
.
.
- name: Generate Protos
run: dev/gen_protos.sh
- name: Create Pull Request
Expand All @@ -32,4 +34,5 @@ jobs:
Auto-generated by [create-pull-request][1]

[1]: https://github.com/peter-evans/create-pull-request
branch: nightly-proto
branch: nightly-proto

9 changes: 3 additions & 6 deletions .github/workflows/push-xbg.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
name: Push XDBG Image

on:
push:
branches:
- main

- develop
workflow_dispatch:

jobs:
push_to_registry:
name: Push Docker Image to GitHub Packages
Expand All @@ -19,14 +17,12 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Log in to the container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
Expand All @@ -46,4 +42,5 @@ jobs:
file: ./dev/xdbg/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
labels: ${{ steps.meta.outputs.labels }}

1 change: 1 addition & 0 deletions .github/workflows/release-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
branches:
- main
- develop
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-ffi-bindings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
branches:
- main
- develop
pull_request:
# only run tests when related changes are made
paths:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-http-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
branches:
- main
- develop
pull_request:
# only run tests when related changes are made
paths:
Expand Down
12 changes: 1 addition & 11 deletions .github/workflows/test-node-bindings.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: Test Node Bindings

on:
push:
branches:
- main

- develop
pull_request:
# only run tests when related changes are made
paths:
Expand All @@ -22,28 +21,23 @@ on:
- "Cargo.toml"
- "Cargo.lock"
- "rust-toolchain"

jobs:
test:
name: Test
runs-on: warp-ubuntu-latest-x64-16x
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Update rust toolchains
run: rustup update

- name: Cache
uses: Swatinem/rust-cache@v2
with:
workspaces: |
.
bindings_node

- name: Start Docker containers
run: dev/up

- name: Setup node
uses: actions/setup-node@v4
with:
Expand All @@ -52,20 +46,16 @@ jobs:
cache: "yarn"
env:
SKIP_YARN_COREPACK_CHECK: "1"

- name: Enable corepack
run: corepack enable

- name: Install dependencies
working-directory: bindings_node
run: |
yarn

- name: Build release
working-directory: bindings_node
run: |
yarn build

- name: Run tests
working-directory: bindings_node
run: |
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-webassembly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
branches:
- main
- develop
pull_request:
# only run tests when related changes are made
paths:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-workspace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
branches:
- main
- develop
pull_request:
# only run tests when related changes are made
paths:
Expand Down
58 changes: 53 additions & 5 deletions dev/docs
Original file line number Diff line number Diff line change
@@ -1,10 +1,58 @@
#!/usr/bin/env bash
set -eou pipefail

rm -rf ./_site
cargo doc --workspace --no-deps
branch_name=$(git symbolic-ref -q HEAD)
branch_name=${branch_name##refs/heads/}
branch_name=${branch_name:-HEAD}

rm -rf ./_site/${branch_name}
cargo doc --workspace --no-deps --all-features --locked
rm -f target/doc/.lock
cp -r target/doc _site
mkdir -p _site/${branch_name}
cp -r target/doc/* _site/${branch_name}/
echo "generating site index"
echo "<meta http-equiv=\"refresh\" content=\"0; url=xmtp_mls/index.html\">" > _site/index.html
chmod -R +rX _site

cat <<EOF > _site/index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Select Version</title>
<style>
body {
font-family: Arial, sans-serif;
text-align: center;
padding: 50px;
}
.button {
display: inline-block;
padding: 15px 30px;
font-size: 20px;
margin: 20px;
text-decoration: none;
color: white;
border-radius: 5px;
transition: 0.3s;
}
.main { background-color: #007bff; }
.develop { background-color: #28a745; }
.button:hover { opacity: 0.8; }
</style>
</head>
<body>

<h1>Select a Version</h1>
<p>Choose which version of the site you want to visit:</p>

<a href="main/xmtp_mls/index.html" class="button main">Main</a>
<a href="develop/xmtp_mls/index.html" class="button develop">Develop</a>

</body>
</html>
EOF

chmod -R +rX _site



Loading