Skip to content

Commit

Permalink
feat: Use github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
nico-famedly committed Jul 15, 2023
1 parent 8f79192 commit 70d1020
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 17 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: "All the sdk specific jobs"

on:
workflow_call:
inputs:
flutter_version:
description: "The flutter version used for tests and builds"
type: string
required: true
dart_version:
description: "The dart version used for tests and builds"
type: string
required: true

jobs:
e2ee_test:
runs-on: ubuntu-latest
env:
HOMESERVER: matrix
HOMESERVER_IMPLEMENTATION: synapse
BASEDIR: "${{github.workspace}}"
container:
image: ghcr.io/famedly/container-image-flutter/flutter:${{inputs.flutter_version}}
volumes:
- /var/run/docker.sock:/var/run/docker.sock
steps:
- uses: actions/checkout@v3
- name: Run tests
run: |
export NETWORK='--network ${{ job.container.network }}'
scripts/integration-prepare-alpine.sh
# deploy homeserver instance
scripts/integration-server-synapse.sh
ip a s
export HOMESERVER="$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' synapse)"
# create test user environment variables
source scripts/integration-create-environment-variables.sh
# properly set the homeserver IP and create test users
scripts/integration-prepare-homeserver.sh
# setup OLM
scripts/prepare.sh
scripts/test_driver.sh
18 changes: 18 additions & 0 deletions .github/workflows/issue-triage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Add issues to Product Management Project.

on:
issues:
types:
- opened

jobs:
add-to-project:
name: Add issue to project
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
# You can target a repository in a different organization
# to the issue
project-url: https://github.com/orgs/famedly/projects/4
github-token: ${{ secrets.ADD_ISSUE_TO_PROJECT_PAT }}
45 changes: 31 additions & 14 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,35 @@
name: Add issues to Product Management Project.
name: CI

on:
issues:
types:
- opened
push:
branches:
- main
pull_request:
merge_group:

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

jobs:
add-to-project:
name: Add issue to project
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
# You can target a repository in a different organization
# to the issue
project-url: https://github.com/orgs/famedly/projects/4
github-token: ${{ secrets.ADD_ISSUE_TO_PROJECT_PAT }}
dart:
permissions:
contents: read
uses: famedly/frontend-ci-templates/.github/workflows/dart.yml@main
with:
flutter_version: 3.10.4
dart_version: 3.0.0
secrets:
ssh_key: "${{ secrets.CI_SSH_PRIVATE_KEY }}"

general:
permissions:
contents: read
uses: famedly/frontend-ci-templates/.github/workflows/general.yml@main

app_jobs:
secrets: inherit
uses: ./.github/workflows/app.yml
with:
flutter_version: 3.10.4
dart_version: 3.0.3
12 changes: 9 additions & 3 deletions scripts/integration-server-synapse.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/usr/bin/env bash
docker run -d --name synapse --tmpfs /data \
--volume="$(pwd)/test_driver/synapse/data/homeserver.yaml":/data/homeserver.yaml:rw \
--volume="$(pwd)/test_driver/synapse/data/localhost.log.config":/data/localhost.log.config:rw \

ls -la $(pwd)/test_driver/synapse/data/homeserver.yaml
docker run -d --name synapse --tmpfs /data $NETWORK --hostname matrix \
--volume="${BASEDIR}/test_driver/synapse/data/homeserver.yaml":/data/homeserver.yaml:rw \
--volume="${BASEDIR}/test_driver/synapse/data/localhost.log.config":/data/localhost.log.config:rw \
-p 80:80 matrixdotorg/synapse:latest

docker exec synapse cat /data/homeserver.yaml

docker inspect synapse

0 comments on commit 70d1020

Please sign in to comment.