1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +01:00

fix: Replace travis with GitHub Actions

closes #656
This commit is contained in:
Ivar Conradi Østhus 2020-11-24 10:22:27 +01:00
parent 351fc636f2
commit 9e48b5a2f4
10 changed files with 960 additions and 697 deletions

44
.github/workflows/build.yaml vendored Normal file
View File

@ -0,0 +1,44 @@
name: Build & Tests
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x, 14.x]
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres
# Provide the password for postgres
env:
POSTGRES_PASSWORD: postgres
# Set health checks to wait until postgres has started
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: yarn
- run: yarn run test:coverage
env:
CI: true
TEST_DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres
DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

25
.github/workflows/generate-docs.yaml vendored Normal file
View File

@ -0,0 +1,25 @@
name: Generate documentation
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: setup git config
run: |
git config --global user.name "${GH_NAME}"
git config --global user.email "${GH_EMAIL}"
echo "machine github.com login ${GH_NAME} password ${GH_TOKEN}" > ~/.netrc
# Stage the file, commit and push
cd website && npm install && GIT_USER="ivarconr" npm run publish-gh-pages
env:
GH_NAME: 'ivarconr'
GH_EMAIL: 'ivarconr@gmail.com'
GH_TOKEN: ${{ secrets.GH_TOKEN }}

View File

@ -1,31 +0,0 @@
sudo: false
language: node_js
node_js:
- '12'
env:
matrix:
- DATABASE_URL=postgres://postgres@localhost:5432/unleash_test TEST_DATABASE_URL=postgres://postgres@localhost:5432/unleash_test
global:
secure: HyWYh1dbUfe2yPF9ZdcdA/IVGyNWmJmpuaRvRGnnpO63/5Y0KT6/hyL6nZ4YJ7Wr/KEt4eMJBJsnzaCFtiqNA3cWyyprzXJButw0o8C6dfd/9jOleisuvdqndu92RqDKIIq2EjHVq3sd6B8uGyiOlkMsyFH57O/V+xHW8MYLnaQ=
before_script:
- psql -c 'create database unleash_test;' -U postgres
script: yarn run test:coverage
after_success:
- yarn run test:coverage-report
notifications:
slack:
secure: MroremSKwtQkwPbrXjgs9hIqKTCDKk7bAIXXzjcS6wXC9uRaFgwFaW8oO3vBxtWa4BL44EQBLE/rboWgqFER62+XgXNgEqGZqrcJHJvby4r+dUNMPI64OZvWdIiydIYxLo8C1C4x5PqBup0xuLq8h/SBnNvA2NLgkjuvzOi+v/Q=
addons:
postgresql: '10'
apt:
packages:
- postgresql-10
- postgresql-client-10
cache:
yarn: true
deploy:
# deploy doc on master to production
- provider: script
script: bash scripts/deploy-docs.sh
on:
branch: master

View File

@ -1,6 +1,6 @@
# Unleash
[![Build Status](https://travis-ci.org/Unleash/unleash.svg?branch=master)](https://travis-ci.org/Unleash/unleash) [![Coverage Status](https://coveralls.io/repos/github/Unleash/unleash/badge.svg?branch=master)](https://coveralls.io/github/Unleash/unleash?branch=master) [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://www.heroku.com/deploy/?template=https://github.com/Unleash/unleash)
![Build & Tests](https://github.com/Unleash/unleash/workflows/Build%20%26%20Tests/badge.svg?branch=master) [![Coverage Status](https://coveralls.io/repos/github/Unleash/unleash/badge.svg?branch=master)](https://coveralls.io/github/Unleash/unleash?branch=master) [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://www.heroku.com/deploy/?template=https://github.com/Unleash/unleash)
Unleash is a open source feature flag & toggle system, that gives you a great overview over all feature toggles across all your applications and services. It comes with official client implementations for Java, Node.js, Go, Ruby, Python and .NET Core.

View File

@ -2,9 +2,9 @@
Here we document features planned for Unleash version 4 and progress for each client SDK. Client SDKs should be able to introduce all features as a minor rev 3. release, and should switch to a version 4.x revision when all features are supported. This makes it easier for the Users to navigate supported features in respecitve clients.
| Feature | Node.js | Java | Python | Ruby | Go | .Net | Client Specifications |
| --------------------------------------------- | ------------------ | ------------------ | ------------------ | ------------------ | --- | ---- | --------------------- |
| Static context fields (#442) | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | | | |
| Strategy constraints (#442) | :fire: | :fire: | | | | | |
| Flexible rollout strategy (#442) | :fire: | :fire: | | | | | |
| Variant support ([docs](../beta-features.md)) | :heavy_check_mark: | :heavy_check_mark: | | :heavy_check_mark: | | | :heavy_check_mark: |
| Feature | Node.js | Java | Python | Ruby | Go | .Net | Client Specifications |
| --- | --- | --- | --- | --- | --- | --- | --- |
| Static context fields (#442) | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | | | |
| Strategy constraints (#442) | :fire: | :fire: | | | | | |
| Flexible rollout strategy (#442) | :fire: | :fire: | | | | | |
| Variant support ([docs](../feature-toggle-variants.md)) | :heavy_check_mark: | :heavy_check_mark: | | :heavy_check_mark: | | | :heavy_check_mark: |

View File

@ -66,7 +66,7 @@ Available unleash options include:
- `custom` - use this when you implement your own custom authentication logic.
- **ui** (object) - Set of UI specific overrides. You may set the following keys: `headerBackground`, `environment`, `slogan`.
- **getLogger** (function) - Used to register a [custom log provider](#How do I configure the log output).
- **eventHook** (`function(event, data)`) - If provided, this function will be invoked whenever a feature is mutated. The possible values for `event` are `'feature-created'`, `'feature-updated'`, `'feature-archived'`, `'feature-revived'`. The `data` argument contains information about the mutation. Its fields are `type` (string) - the event type (same as `event`); `createdBy` (string) - the user who performed the mutation; `data` - the contents of the change. The contents in `data` differs based on the event type; For `'feature-archived'` and `'feature-revived'`, the only field will be `name` - the name of the feature. For `'feature-created'` and `'feature-updated'` the data follows a schema defined in the code [here](https://github.com/Unleash/unleash/blob/master/lib/routes/admin-api/feature-schema.js#L38-L59). See an example [here](./guides/feautre-updates-to-slack.md).
- **eventHook** (`function(event, data)`) - If provided, this function will be invoked whenever a feature is mutated. The possible values for `event` are `'feature-created'`, `'feature-updated'`, `'feature-archived'`, `'feature-revived'`. The `data` argument contains information about the mutation. Its fields are `type` (string) - the event type (same as `event`); `createdBy` (string) - the user who performed the mutation; `data` - the contents of the change. The contents in `data` differs based on the event type; For `'feature-archived'` and `'feature-revived'`, the only field will be `name` - the name of the feature. For `'feature-created'` and `'feature-updated'` the data follows a schema defined in the code [here](https://github.com/Unleash/unleash/blob/master/lib/routes/admin-api/feature-schema.js#L38-L59). See an example [here](./guides/feature-updates-to-slack.md).
- **baseUriPath** (string) - use to register a base path for all routes on the application. For example `/my/unleash/base` (note the starting /). Defaults to `/`. Can also be configured through the environment variable `BASE_URI_PATH`.
- **secureHeaders** (boolean) - use this to enable security headers (HSTS, CSP, etc) when serving Unleash from HTTPS. Can also be configured through the environment variable `SECURE_HEADERS`.

View File

@ -45,7 +45,7 @@
"test:watch": "npm run test -- --watch",
"test:pg-virtualenv": "pg_virtualenv npm run test:pg-virtualenv-chai",
"test:pg-virtualenv-chain": "export TEST_DATABASE_URL=postgres://$PGUSER:$PGPASSWORD@localhost:$PGPORT/postgres ; npm run db-migrate-testdb && npm test",
"test:coverage": "nyc npm run test",
"test:coverage": "nyc --reporter=lcov npm run test",
"test:coverage-report": "nyc report --reporter=text-lcov | coveralls"
},
"nyc": {

View File

@ -1,6 +0,0 @@
#!/bin/bash
git config --global user.name "${GH_NAME}"
git config --global user.email "${GH_EMAIL}"
echo "machine github.com login ${GH_NAME} password ${GH_TOKEN}" > ~/.netrc
cd website && npm install && GIT_USER="${GH_NAME}" npm run publish-gh-pages

View File

@ -10,7 +10,7 @@
"rename-version": "docusaurus-rename-version"
},
"devDependencies": {
"docusaurus": "^1.14.4"
"docusaurus": "^1.14.6"
},
"resolutions": {
"minimist": "^1.2.5",

File diff suppressed because it is too large Load Diff