-
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
Changes from 20 commits
b24c69c
807e2cf
18b5d3c
8fb6ac0
85bc298
78f2d77
adf70a1
eda6205
95416d7
e6c512f
08f3686
8bcb227
01d24e7
541420a
96f1e7c
adcf181
2030852
05afd29
41acbcf
9b287d7
d4f944a
be8977e
3249c5d
de86ab8
158a90c
5a6409a
b2becc7
49038c8
7731810
c6c92d6
b7087ad
9a6ed61
7ef3af4
63776ef
0442d28
83ca8ea
f24abdb
42348c8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
name: Build | ||
description: Run Build | ||
runs: | ||
using: "composite" | ||
steps: | ||
- run: npm install --silent --unsafe-perm | ||
shell: bash | ||
- run: npm run prepack | ||
shell: bash |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
name: ESLint | ||
description: Run ESLint | ||
runs: | ||
using: "composite" | ||
steps: | ||
- run: npm ci --silent | ||
shell: bash | ||
- run: npm run --silent test:lint | ||
shell: bash |
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,19 @@ | ||||||||||||||
name: Functional Tests | ||||||||||||||
description: Run Functional Tests | ||||||||||||||
runs: | ||||||||||||||
using: "composite" | ||||||||||||||
steps: | ||||||||||||||
- run: npm install --silent --unsafe-perm | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did you use --unsafe-perm? It seems to me that runners are not containers
Suggested change
|
||||||||||||||
shell: bash | ||||||||||||||
- run: npm pack | ||||||||||||||
shell: bash | ||||||||||||||
- run: tar xf kourou-$(node -e 'console.log(require("./package.json").version)').tgz | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is a dedicated action to get package.json version https://github.com/marketplace/actions/get-current-package-version There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is unnecessary, see my comment below |
||||||||||||||
shell: bash | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not just run typescript compile instead of packing and unpacking?
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because we want to test the generated NPM package and not the source code |
||||||||||||||
- run: npm install --prefix package --silent --unsafe-perm --only production | ||||||||||||||
shell: bash | ||||||||||||||
- run: rm -rf ./bin | ||||||||||||||
shell: bash | ||||||||||||||
- run: features/run-kuzzle-stack.sh | ||||||||||||||
shell: bash | ||||||||||||||
- run: npm run test:functional:cucumber | ||||||||||||||
shell: bash |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,17 @@ | ||||||
name: Functional Tests | ||||||
description: Run Functional Tests | ||||||
runs: | ||||||
using: "composite" | ||||||
steps: | ||||||
- run: npm install --silent --unsafe-perm | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did you use
Suggested change
|
||||||
shell: bash | ||||||
- run: npm pack | ||||||
shell: bash | ||||||
- run: tar xf kourou-$(node -e 'console.log(require("./package.json").version)').tgz | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is a dedicated action to get package.json version https://github.com/marketplace/actions/get-current-package-version There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure we want to replace a very straightforward line by another dependency just to extract the version number from a package 🤔 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Specially when I see the code the use for that 😅
It looks like Github Action is the new NPM and we should be aware of including too much useless dependencies (like |
||||||
shell: bash | ||||||
- run: npm install --prefix package --silent --unsafe-perm --only production | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did you use --unsafe-perm? It seems to me that runners are not containers
Suggested change
|
||||||
shell: bash | ||||||
- run: rm -rf ./bin | ||||||
shell: bash | ||||||
- run: npm run test:functional:stdout | ||||||
shell: bash |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
name: Run tests | ||
|
||
on: [pull_request] | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
rolljee marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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 | ||
|
||
lint: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMO, Linting job should be executed before |
||
name: Lint | ||
runs-on: ubuntu-latest | ||
needs: build | ||
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 | ||
|
||
functional-test-stdout: | ||
name: Functional Test Stdout | ||
runs-on: ubuntu-latest | ||
rolljee marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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/functional-test-stdout | ||
env: | ||
KOUROU_RUNTIME: "./package/bin/run" | ||
|
||
functional-test-cucumber: | ||
name: Functional Test Cucumber | ||
runs-on: ubuntu-latest | ||
rolljee marked this conversation as resolved.
Show resolved
Hide resolved
|
||
needs: lint | ||
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" | ||
- uses: ./.github/actions/functional-test-cucumber | ||
env: | ||
KOUROU_RUNTIME: "./package/bin/run" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Publish to npm | ||
|
||
on: [release] | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
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 }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where are stored the secrets? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are stored per repository in |
This file was deleted.
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.
Why did you use --unsafe-perm? It seems to me that runners are not containers