Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into hs/rs-message-queues
Browse files Browse the repository at this point in the history
  • Loading branch information
Half-Shot committed Jan 5, 2024
2 parents bdfbc63 + 675c1c1 commit 6be34e5
Show file tree
Hide file tree
Showing 205 changed files with 11,130 additions and 4,344 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ module.exports = {
},
rules: {
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-unused-vars": "warn",
"camelcase": ["error", { "properties": "never", "ignoreDestructuring": true }],
"no-console": "error"
},
Expand Down Expand Up @@ -48,6 +50,7 @@ module.exports = {
rules: {
"no-console": "off",
"no-unused-vars": "off",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-unused-vars": ["error"],
"no-useless-constructor": "off",
"@typescript-eslint/no-useless-constructor": ["error"],
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/docker-hub-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ on:
branches: [ main ]
paths-ignore:
- changelog.d/**'
merge_group:


concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
DOCKER_NAMESPACE: halfshot
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/docker-hub-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ env:
DOCKER_NAMESPACE: halfshot
PLATFORMS: linux/amd64,linux/arm64

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
docker-release:
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/docs-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
paths-ignore:
- changelog.d/**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
deploy:
runs-on: ubuntu-20.04
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/docs-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
release:
types: [published]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
deploy:
runs-on: ubuntu-20.04
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/helm-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Helm Chart - Validate
on:
push:
branches: [ main ]
paths-ignore:
- changelog.d/**'
pull_request:
branches: [ main ]
paths-ignore:
- changelog.d/**'

workflow_dispatch:
jobs:
lint-helm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Lint Helm
uses: WyriHaximus/github-action-helm3@v3
with:
exec: helm lint ./helm/hookshot/

- name: Validate
uses: nlamirault/[email protected]
with:
charts: ./helm/
56 changes: 56 additions & 0 deletions .github/workflows/helm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Helm Chart - Release

on:
push:
branches:
- main
paths:
- 'helm/**' # only execute if we have helm chart changes
workflow_dispatch:

jobs:
release:
# depending on default permission settings for your org (contents being read-only or read-write for workloads), you will have to add permissions
# see: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Install Helm
uses: azure/setup-helm@v3
with:
version: v3.10.0

- name: "Get app version from package.json"
id: get_hookshot_version
run: |
echo "hookshot_version=$(cat package.json | yq .version)" >> "$GITHUB_OUTPUT"
- name: Set chart appVersion to current package.json version
uses: mikefarah/[email protected]
with:
cmd: |
yq -i '.appVersion="${{steps.get_hookshot_version.outputs.hookshot_version}}"' helm/hookshot/Chart.yaml
- name: Set values hookshot config to current config.sample.yml contents
uses: mikefarah/[email protected]
with:
cmd: |
yq -i eval-all 'select(fileIndex==0).hookshot.config = select(fileIndex==1) | select(fileIndex==0)' helm/hookshot/values.yaml config.sample.yml
- name: Run chart-releaser
uses: helm/[email protected]
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
with:
config: helm/cr.yaml
charts_dir: helm/
89 changes: 87 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ on:
- changelog.d/**'

workflow_dispatch:
merge_group:


concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
lint-node:
Expand All @@ -34,6 +40,7 @@ jobs:
profile: minimal
components: rustfmt
- run: cargo fmt --all -- --check
- run: cargo clippy -- -Dwarnings

config:
runs-on: ubuntu-latest
Expand All @@ -44,7 +51,7 @@ jobs:
with:
node-version-file: .node-version
- run: yarn # Need to build scripts to get rust bindings
- run: yarn --silent ts-node src/Config/Defaults.ts --config | diff config.sample.yml -
- run: yarn --silent ts-node src/config/Defaults.ts --config | diff config.sample.yml -

metrics-docs:
runs-on: ubuntu-latest
Expand All @@ -62,7 +69,7 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
node_version: [18, 20]
node_version: [20, 21]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node_version }}
Expand All @@ -73,5 +80,83 @@ jobs:
with:
toolchain: stable
profile: minimal
- uses: Swatinem/rust-cache@v2
with:
shared-key: rust-cache
- run: yarn
- run: yarn test:cover

build-homerunner:
runs-on: ubuntu-latest
outputs:
homerunnersha: ${{ steps.gitsha.outputs.sha }}
steps:
- name: Checkout matrix-org/complement
uses: actions/checkout@v3
with:
repository: matrix-org/complement
- name: Get complement git sha
id: gitsha
run: echo sha=`git rev-parse --short HEAD` >> "$GITHUB_OUTPUT"
- name: Cache homerunner
id: cached
uses: actions/cache@v3
with:
path: homerunner
key: ${{ runner.os }}-homerunner-${{ steps.gitsha.outputs.sha }}
- name: "Set Go Version"
if: ${{ steps.cached.outputs.cache-hit != 'true' }}
run: |
echo "$GOROOT_1_18_X64/bin" >> $GITHUB_PATH
echo "~/go/bin" >> $GITHUB_PATH
# Build and install homerunner
- name: Install Complement Dependencies
if: ${{ steps.cached.outputs.cache-hit != 'true' }}
run: |
sudo apt-get update && sudo apt-get install -y libolm3 libolm-dev
- name: Build homerunner
if: ${{ steps.cached.outputs.cache-hit != 'true' }}
run: |
go build ./cmd/homerunner
integration-test:
runs-on: ubuntu-latest
timeout-minutes: 30
needs:
- test
- build-homerunner
steps:
- name: Install Complement Dependencies
run: |
sudo apt-get update && sudo apt-get install -y libolm3
- name: Load cached homerunner bin
uses: actions/cache@v3
with:
path: homerunner
key: ${{ runner.os }}-homerunner-${{ needs.build-synapse.outputs.homerunnersha }}
fail-on-cache-miss: true # Shouldn't happen, we build this in the needs step.
- name: Checkout matrix-hookshot
uses: actions/checkout@v3
with:
path: matrix-hookshot
# Setup node & run tests
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version-file: matrix-hookshot/.node-version
- uses: Swatinem/rust-cache@v2
with:
workspaces: matrix-hookshot
shared-key: rust-cache
- name: Run Homerunner tests
timeout-minutes: 10
env:
HOMERUNNER_SPAWN_HS_TIMEOUT_SECS: 100
HOMERUNNER_IMAGE: ghcr.io/element-hq/synapse/complement-synapse:latest
NODE_OPTIONS: --dns-result-order ipv4first
run: |
docker pull $HOMERUNNER_IMAGE
cd matrix-hookshot
yarn --strict-semver --frozen-lockfile
../homerunner &
bash -ic 'yarn test:e2e'
1 change: 1 addition & 0 deletions .github/workflows/newsfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Newsfile
on:
pull_request:
branches: [ main ]
merge_group:

jobs:
changelog:
Expand Down
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18
20
Loading

0 comments on commit 6be34e5

Please sign in to comment.