-
Notifications
You must be signed in to change notification settings - Fork 4
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
Move to Github Actions #90
Merged
Merged
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
b24c69c
wip new-ci
rolljee 807e2cf
wip new ci
rolljee 18b5d3c
use actions/checkout
rolljee 8fb6ac0
wip CI
rolljee 85bc298
Add deploy job only in master branch
rolljee 78f2d77
Add jobs to CI
rolljee adf70a1
remove unused if check
rolljee eda6205
Nitpicking
rolljee 95416d7
apply changes
rolljee e6c512f
Improve new ci
rolljee 08f3686
rename folder in actions
rolljee 8bcb227
wip kourou ci
rolljee 01d24e7
Merge branch 'develop' of github.com:kuzzleio/kourou into feat/move-t…
rolljee 541420a
merge develop
rolljee 96f1e7c
remove option in tsconfig.json
rolljee adcf181
express need between build and tests
rolljee 2030852
add missing env variable
rolljee 05afd29
ci
rolljee 41acbcf
add env var
rolljee 9b287d7
Update ci
rolljee d4f944a
requested changes
rolljee be8977e
Name action steps
rolljee 3249c5d
Put env in dedicated action file
rolljee de86ab8
Update .github/workflows/pull_request.workflow.yml
rolljee 158a90c
Update .github/workflows/pull_request.workflow.yml
rolljee 5a6409a
Update .github/workflows/pull_request.workflow.yml
rolljee b2becc7
Use Artifacts and better file organisation
alexandrebouthinon 49038c8
Fix typo
alexandrebouthinon 7731810
Fix typo in artifact path
alexandrebouthinon c6c92d6
Debug artifact download
alexandrebouthinon b7087ad
Fix artifact download and setup
alexandrebouthinon 9a6ed61
Install only devDependencies to perform tests
alexandrebouthinon 7ef3af4
Install all needed dependencies for tests
alexandrebouthinon 63776ef
Try to copy features and test directory in uncompressed artifact
alexandrebouthinon 0442d28
Copy MochaRC and NYCRC into artifact directory
alexandrebouthinon 83ca8ea
Try to only install dev deps
alexandrebouthinon f24abdb
Perform last optimisations
alexandrebouthinon 42348c8
Fix functional tests
alexandrebouthinon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
name: Build | ||
description: Run Build | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Install deps | ||
run: npm ci --silent | ||
shell: bash | ||
- name: Build and package the application | ||
run: npm pack | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
name: ESLint | ||
description: Run ESLint | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Install deps | ||
run: npm ci --silent | ||
shell: bash | ||
- name: Run lint tests | ||
run: npm run --silent test:lint | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: Functional Tests | ||
description: Run Functional Tests | ||
inputs: | ||
test-set: | ||
description: Test set to run | ||
required: true | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Run functional test | ||
run: | | ||
cd package | ||
npm install --silent | ||
features/run-kuzzle-stack.sh | ||
npm run test:functional:${{ inputs.test-set }} | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
name: Run tests | ||
|
||
on: [pull_request] | ||
|
||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Cache node modules | ||
uses: actions/cache@v2 | ||
env: | ||
cache-name: cache-node-modules | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}- | ||
${{ runner.os }}-build- | ||
${{ runner.os }}- | ||
- uses: actions/setup-node@v1.4.4 | ||
with: | ||
node-version: 12 | ||
- uses: ./.github/actions/es-lint | ||
|
||
build: | ||
name: Build | ||
runs-on: ubuntu-18.04 | ||
needs: [lint] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Cache node modules | ||
uses: actions/cache@v2 | ||
env: | ||
cache-name: cache-node-modules | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}- | ||
${{ runner.os }}-build- | ||
${{ runner.os }}- | ||
- uses: actions/setup-node@v1.4.4 | ||
with: | ||
node-version: 12 | ||
- uses: ./.github/actions/build | ||
Aschen marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- name: Store build archive as artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: kourou-build | ||
path: ./kourou-*.tgz | ||
|
||
functional-test: | ||
name: Functional Test - ${{ matrix.test-set }} | ||
runs-on: ubuntu-18.04 | ||
needs: [build] | ||
strategy: | ||
matrix: | ||
test-set: [stdout, cucumber] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Cache node modules | ||
uses: actions/cache@v2 | ||
env: | ||
cache-name: cache-node-modules | ||
NODE_ENV: test | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}- | ||
${{ runner.os }}-build- | ||
${{ runner.os }}- | ||
- uses: actions/setup-node@v1.4.4 | ||
with: | ||
node-version: 12 | ||
- name: Recover previously built Kourou | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: kourou-build | ||
- name: Unpack and prepare artifact for tests | ||
run: | | ||
tar xfz ./kourou-*.tgz | ||
cp -fr .mocharc.json .nycrc tsconfig.json features test package/ | ||
- uses: ./.github/actions/functional-test | ||
with: | ||
test-set: ${{ matrix.test-set }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
name: Run tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- develop | ||
|
||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Cache node modules | ||
uses: actions/cache@v2 | ||
env: | ||
cache-name: cache-node-modules | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}- | ||
${{ runner.os }}-build- | ||
${{ runner.os }}- | ||
- uses: actions/setup-node@v1.4.4 | ||
with: | ||
node-version: 12 | ||
- uses: ./.github/actions/es-lint | ||
|
||
build: | ||
name: Build | ||
runs-on: ubuntu-18.04 | ||
needs: [lint] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Cache node modules | ||
uses: actions/cache@v2 | ||
env: | ||
cache-name: cache-node-modules | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}- | ||
${{ runner.os }}-build- | ||
${{ runner.os }}- | ||
- uses: actions/setup-node@v1.4.4 | ||
with: | ||
node-version: 12 | ||
- uses: ./.github/actions/build | ||
- name: Store build archive as artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: kourou-build | ||
path: ./kourou-*.tgz | ||
|
||
functional-test: | ||
name: Functional Test - ${{ matrix.test-set }} | ||
runs-on: ubuntu-18.04 | ||
needs: [build] | ||
strategy: | ||
matrix: | ||
test-set: [stdout, cucumber] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Cache node modules | ||
uses: actions/cache@v2 | ||
env: | ||
cache-name: cache-node-modules | ||
NODE_ENV: test | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}- | ||
${{ runner.os }}-build- | ||
${{ runner.os }}- | ||
- uses: actions/setup-node@v1.4.4 | ||
with: | ||
node-version: 12 | ||
- name: Recover previously built Kourou | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: kourou-build | ||
- name: Unpack and prepare artifact for tests | ||
run: | | ||
tar xfz ./kourou-*.tgz | ||
cp -fr .mocharc.json .nycrc tsconfig.json features test package/ | ||
- uses: ./.github/actions/functional-test | ||
with: | ||
test-set: ${{ matrix.test-set }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
name: Run tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Cache node modules | ||
uses: actions/cache@v2 | ||
env: | ||
cache-name: cache-node-modules | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}- | ||
${{ runner.os }}-build- | ||
${{ runner.os }}- | ||
- uses: actions/setup-node@v1.4.4 | ||
with: | ||
node-version: 12 | ||
- uses: ./.github/actions/es-lint | ||
|
||
build: | ||
name: Build | ||
runs-on: ubuntu-18.04 | ||
needs: [lint] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Cache node modules | ||
uses: actions/cache@v2 | ||
env: | ||
cache-name: cache-node-modules | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}- | ||
${{ runner.os }}-build- | ||
${{ runner.os }}- | ||
- uses: actions/setup-node@v1.4.4 | ||
with: | ||
node-version: 12 | ||
- uses: ./.github/actions/build | ||
- name: Store build archive as artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: kourou-build | ||
path: ./kourou-*.tgz | ||
|
||
functional-test: | ||
name: Functional Test - ${{ matrix.test-set }} | ||
runs-on: ubuntu-18.04 | ||
needs: [build] | ||
strategy: | ||
matrix: | ||
test-set: [stdout, cucumber] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Cache node modules | ||
uses: actions/cache@v2 | ||
env: | ||
cache-name: cache-node-modules | ||
NODE_ENV: test | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}- | ||
${{ runner.os }}-build- | ||
${{ runner.os }}- | ||
- uses: actions/setup-node@v1.4.4 | ||
with: | ||
node-version: 12 | ||
- name: Recover previously built Kourou | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: kourou-build | ||
- name: Unpack and prepare artifact for tests | ||
run: | | ||
tar xfz ./kourou-*.tgz | ||
cp -fr .mocharc.json .nycrc tsconfig.json features test package/ | ||
- uses: ./.github/actions/functional-test | ||
with: | ||
test-set: ${{ matrix.test-set }} | ||
|
||
deploy: | ||
name: Deploy to NPM.js | ||
runs-on: ubuntu-18.04 | ||
needs: [functional-test] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12 | ||
registry-url: "https://registry.npmjs.org" | ||
- run: npm install | ||
- run: npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, Linting job should be executed before
build
. No need to build the app if the code doesn't pass linters successfully