Skip to content

Commit

Permalink
publish to wire-builds (#4445)
Browse files Browse the repository at this point in the history
* refactor: branch vs pr pipelines

* reinstate lint

* always push docker image

* target branch

* Add helm chart

* publish helm chart

* Add publish to wire-builds step

* fix debug

* fix: upgrade account-pages

* fix: image_tag not defined as output

* Remove test triggers

* test: update to remove warnings

* chore: update prettier plugin

* chore: trying to fix deps

* chore: fix

---------

Co-authored-by: Timothy LeBon <[email protected]>
  • Loading branch information
smatting and tlebon authored Jan 23, 2024
1 parent 3252290 commit 3ac1c04
Show file tree
Hide file tree
Showing 20 changed files with 1,323 additions and 540 deletions.
12 changes: 12 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"env": {
"jasmine": true
},
"parser": "@typescript-eslint/parser",
"plugins": ["jest"],
"extends": ["@wireapp/eslint-config", "plugin:jest/recommended"],
"overrides": [
Expand All @@ -19,8 +20,19 @@
"project": ["./tsconfig.json", "./server/tsconfig.json"]
},
"rules": {
"id-length": [
"error",
{
"exceptions": ["t"]
}
],
"import/no-default-export": "off",
"jest/no-jasmine-globals": "warn",
"jest/no-try-expect": "off"
},
"settings": {
"react": {
"version": "detect"
}
}
}
85 changes: 85 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: CI

on:
push:
branches: [staging, main]
tags:
- v*
pull_request:
branches: [staging, main]

jobs:
test_build_deploy:
runs-on: ubuntu-latest

strategy:
matrix:
DISTRIBUTION: ['DISTRIBUTION_0']

env:
TEST_COVERAGE_FAIL_THRESHOLD: 10
TEST_COVERAGE_WARNING_THRESHOLD: 50
DEPLOYMENT_RECOVERY_TIMEOUT_SECONDS: 150
AWS_APPLICATION_NAME: Account
AWS_BUILD_ZIP_PATH: 'wire-account.zip'

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set environment variables
env:
# DISTRIBUTIONS are saved in the format `distribution-{name}`
DISTRIBUTION: ${{secrets[matrix.DISTRIBUTION]}}
run: |
echo "BRANCH_NAME=$(git branch --show-current)" >> $GITHUB_ENV
echo "TAG=$(git tag --points-at ${{github.sha}})" >> $GITHUB_ENV
echo "COMMIT_MESSAGE=$(git log --format=%B -n 1 ${{github.event.after}} | head -n 1)" >> $GITHUB_ENV
echo "DISTRIBUTION=${DISTRIBUTION/distribution-/}" >> $GITHUB_ENV
- name: Set TITLE
env:
PR_TITLE: ${{github.event.pull_request.title || env.COMMIT_MESSAGE}}
run: echo "TITLE=$PR_TITLE" >> $GITHUB_ENV

- name: Print environment variables
env:
GITHUB_CONTEXT: ${{toJson(github)}}
run: |
echo -e "BRANCH_NAME = ${BRANCH_NAME}"
echo -e "TAG = ${TAG}"
echo -e "TITLE = ${TITLE}"
echo -e "COMMIT_MESSAGE = ${COMMIT_MESSAGE}"
echo -e "GITHUB_CONTEXT = ${GITHUB_CONTEXT}"
- name: Skip CI
if: contains(env.TITLE || env.COMMIT_MESSAGE, '[skip ci]') || contains(env.TITLE || env.COMMIT_MESSAGE, '[ci skip]')
uses: andymckay/[email protected]

- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{github.token}}

- name: Yarn cache
uses: c-hive/[email protected]

- name: Authenticate git clone
env:
GH_TOKEN: ${{secrets.OTTO_THE_BOT_GH_TOKEN}}
run: echo -e "machine github.com\n login ${GH_TOKEN}" > ~/.netrc

- name: Install JS dependencies
run: yarn --immutable

- name: Test
run: yarn test

- name: Monitor coverage
if: github.event_name == 'pull_request' && ! contains(github.event.pull_request.user.login, 'dependabot[bot]')
uses: slavcodev/[email protected]
with:
github_token: ${{github.token}}
coverage_path: 'coverage/clover.xml'
threshold_alert: ${{env.TEST_COVERAGE_FAIL_THRESHOLD}}
threshold_warning: ${{env.TEST_COVERAGE_WARNING_THRESHOLD}}
Loading

0 comments on commit 3ac1c04

Please sign in to comment.