-
Notifications
You must be signed in to change notification settings - Fork 3.7k
GitHub actions #1635
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
GitHub actions #1635
Changes from all commits
83992f8
a8389b2
06968a8
fd18ca5
e4bde9b
ae53158
bcc1049
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,68 @@ | ||
| name: "Tests" | ||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: | ||
| - master | ||
|
|
||
| jobs: | ||
| Test: | ||
| if: "!contains(github.event.head_commit.message, '[skip ci]')" | ||
| strategy: | ||
| matrix: | ||
| node_version: ['lts/*', 'node'] | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout Code | ||
| uses: actions/checkout@v2 | ||
| - name: Install Node | ||
| uses: dcodeIO/setup-node-nvm@master | ||
| with: | ||
| node-version: ${{ matrix.node_version }} | ||
| - name: Install Dependencies | ||
| run: npm ci | ||
| - name: Run Unit Tests 👩🏽💻 | ||
|
Member
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. Should we run lint before unit tests instead of a separate job? If it fails lint then it could fail fast.
Member
Author
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 it would be better to run in parallel. We could turn off the fail-fast so it will always run both tests on node and lts and lint. For that matter we could also run unit tests and spec tests in parallel too if we wanted. |
||
| run: npm run test:unit | ||
| - name: Run Spec Tests 👩🏽💻 | ||
| run: npm run test:specs | ||
|
|
||
| Lint: | ||
| if: "!contains(github.event.head_commit.message, '[skip ci]')" | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout Code | ||
| uses: actions/checkout@v2 | ||
| - name: Install Dependencies | ||
| run: npm ci | ||
| - name: Lint ✨ | ||
| run: npm run test:lint | ||
|
|
||
| Build: | ||
| needs: [Test, Lint] | ||
| if: github.ref == 'refs/heads/master' | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout Code | ||
| uses: actions/checkout@v2 | ||
| - name: Install Node | ||
| run: nvm lts/* | ||
| - name: Install Dependencies | ||
| run: npm ci | ||
| - name: Build 🗜️ | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| npm run build | ||
| if ! git diff --quiet; then | ||
| git config --global user.email "<>" | ||
| git config --global user.name "MarkedJS bot" | ||
| git commit -am "🗜️ build [skip ci]" | ||
| git push "https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/markedjs/marked.git" HEAD:master | ||
| fi | ||
|
|
||
| Skip: | ||
| if: contains(github.event.head_commit.message, '[skip ci]') | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Skip CI 🚫 | ||
| run: echo skip ci | ||
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
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.
I think I would rather use the official node.js action and run tests on mac and windows as well as linux. Is this only used to reference
lts?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.
Yes, there is no way to reference
ltsorlatestwith the official node.js action. And updating the version number will be forgotten if we don't automate it.Uh oh!
There was an error while loading. Please reload this page.
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.
I don't really see how this library can change depending on which os it is on. It has no dependencies and no os dependent code.
If it does run differently on different os's with node that would be a node issue not a marked issue.
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.
I suppose maybe testing the cli but we don't do that right now anyway.