-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[CI]Add docker and npm caching #6748
Merged
Merged
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
c839fe1
Add docker and npm caching
unlikelyzero 926095b
add caching to platform
unlikelyzero 5fe76bb
use node_version
unlikelyzero e528fe0
bump to 18 and rearrange
unlikelyzero d0c5685
bump to 18 and include caching
unlikelyzero 5675b56
bump to 18
unlikelyzero 0d57808
use node_version
unlikelyzero 6548137
closing bracket
unlikelyzero ea81cf3
update windows eol for prettier
unlikelyzero 1cc355b
no lock
unlikelyzero 2f08565
npm install with cache
unlikelyzero 2d8dd76
no audit
unlikelyzero 977bbca
fix broken dependabot triggers
unlikelyzero b408678
remove comments
unlikelyzero ad84d0d
two fixes
unlikelyzero 8f1f7a9
Merge branch 'master' into caching-for-workflows
unlikelyzero 7ce3903
remove comment and add timeout
unlikelyzero 480a4be
Merge branch 'caching-for-workflows' of https://github.com/nasa/openm…
unlikelyzero c38026a
always remove and reference labelToRemove
unlikelyzero 61568bc
Merge branch 'master' into caching-for-workflows
unlikelyzero 529168b
Merge branch 'master' into caching-for-workflows
ozyx 7cb2084
debug
ozyx 0046d20
debug
ozyx 6e07d7c
filter out some events
ozyx c684926
Revert "debug"
ozyx b9e4fbb
Revert "debug"
ozyx 30c68de
Revert "filter out some events"
ozyx 1f1a54f
remove dependabot actor check
ozyx 63a8254
remove "opened" check in if statement
ozyx 61362b6
moar debug
ozyx 5f887fe
syntax
ozyx 8062611
Revert "syntax"
ozyx 2f6db6f
Revert "moar debug"
ozyx 2b9b8ee
Revert "remove "opened" check in if statement"
ozyx baefa6a
Revert "remove dependabot actor check"
ozyx 0ed4c8a
try removing `${{ }}`
ozyx 78f30bd
more syntax
ozyx b6d6133
try wrapping in singular `${{ }}`
ozyx 3bb7fdc
fix label names
ozyx cab322f
Merge branch 'master' into caching-for-workflows
ozyx 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 |
---|---|---|
|
@@ -7,42 +7,65 @@ on: | |
- opened | ||
jobs: | ||
e2e-couchdb: | ||
if: ${{ github.event.label.name == 'pr:e2e:couchdb' }} || ${{ github.event.action == 'opened' }} | ||
if: github.event.label.name == 'pr:e2e:couchdb' || github.event.action == 'opened' && github.actor == 'dependabot[bot]' | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 'lts/gallium' | ||
node-version: 'lts/hydrogen' | ||
|
||
- name: Cache NPM dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
|
||
- run: npm install --cache ~/.npm --prefer-offline --no-audit --progress=false | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- run: npx [email protected] install | ||
- run: npm install | ||
|
||
- name: Start CouchDB Docker Container and Init with Setup Scripts | ||
run: | | ||
export $(cat src/plugins/persistence/couch/.env.ci | xargs) | ||
docker-compose -f src/plugins/persistence/couch/couchdb-compose.yaml up --detach | ||
sleep 3 | ||
bash src/plugins/persistence/couch/setup-couchdb.sh | ||
bash src/plugins/persistence/couch/replace-localstorage-with-couchdb-indexhtml.sh | ||
|
||
- name: Run CouchDB Tests and publish to deploysentinel | ||
env: | ||
DEPLOYSENTINEL_API_KEY: ${{ secrets.DEPLOYSENTINEL_API_KEY }} | ||
run: npm run test:e2e:couchdb | ||
|
||
- name: Publish Results to Codecov.io | ||
env: | ||
SUPER_SECRET: ${{ secrets.CODECOV_TOKEN }} | ||
run: npm run cov:e2e:full:publish | ||
|
||
- name: Archive test results | ||
if: success() || failure() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
path: test-results | ||
|
||
- name: Archive html test results | ||
if: success() || failure() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
path: html-test-results | ||
|
||
- name: Remove pr:e2e:couchdb label (if present) | ||
if: ${{ contains(github.event.pull_request.labels.*.name, 'pr:e2e:couchdb') }} | ||
if: always() | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
|
@@ -56,5 +79,5 @@ jobs: | |
name: labelToRemove | ||
}); | ||
} catch (error) { | ||
core.warning(`Failed to remove 'pr:e2e:couchdb' label: ${error.message}`); | ||
core.warning(`Failed to remove ' + labelToRemove + ' label: ${error.message}`); | ||
} |
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 |
---|---|---|
|
@@ -7,31 +7,31 @@ on: | |
- opened | ||
jobs: | ||
e2e-full: | ||
if: ${{ github.event.label.name == 'pr:e2e' }} | ||
if: github.event.label.name == 'pr:e2e' || github.event.action == 'opened' && github.actor == 'dependabot[bot]' | ||
runs-on: ${{ matrix.os }} | ||
timeout-minutes: 60 | ||
strategy: | ||
matrix: | ||
os: | ||
- ubuntu-latest | ||
- windows-latest | ||
steps: | ||
- name: Trigger Success | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
github.rest.issues.createComment({ | ||
issue_number: context.issue.number, | ||
owner: "nasa", | ||
repo: "openmct", | ||
body: 'Started e2e Run. Follow along: https://github.com/nasa/openmct/actions/runs/' + context.runId | ||
}) | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16' | ||
node-version: 'lts/hydrogen' | ||
|
||
- name: Cache NPM dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
|
||
- run: npx [email protected] install | ||
- run: npx playwright install chrome-beta | ||
- run: npm install | ||
- run: npm install --cache ~/.npm --prefer-offline --no-audit --progress=false | ||
- run: npm run test:e2e:full -- --max-failures=40 | ||
- run: npm run cov:e2e:report || true | ||
- shell: bash | ||
|
@@ -44,30 +44,9 @@ jobs: | |
uses: actions/upload-artifact@v3 | ||
with: | ||
path: test-results | ||
- name: Test success | ||
if: ${{ success() }} | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
github.rest.issues.createComment({ | ||
issue_number: context.issue.number, | ||
owner: "nasa", | ||
repo: "openmct", | ||
body: 'Success ✅ ! Build artifacts are here: https://github.com/nasa/openmct/actions/runs/' + context.runId | ||
}) | ||
- name: Test failure | ||
if: ${{ failure() }} | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
github.rest.issues.createComment({ | ||
issue_number: context.issue.number, | ||
owner: "nasa", | ||
repo: "openmct", | ||
body: 'Failure ❌ ! Build artifacts are here: https://github.com/nasa/openmct/actions/runs/' + context.runId | ||
}) | ||
|
||
- name: Remove pr:e2e label (if present) | ||
if: ${{ contains(github.event.pull_request.labels.*.name, 'pr:e2e') }} | ||
if: always() | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
|
@@ -81,5 +60,5 @@ jobs: | |
name: labelToRemove | ||
}); | ||
} catch (error) { | ||
core.warning(`Failed to remove 'pr:e2e' label: ${error.message}`); | ||
} | ||
core.warning(`Failed to remove ' + labelToRemove + ' label: ${error.message}`); | ||
} |
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
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
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"trailingComma": "none", | ||
"singleQuote": true, | ||
"printWidth": 100 | ||
"printWidth": 100, | ||
"endOfLine": "auto" | ||
ozyx marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} |
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.
remove the comments which aren't useful