-
-
Notifications
You must be signed in to change notification settings - Fork 97
Workflows #41
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
Open
Skenvy
wants to merge
31
commits into
yoavbls:new-ci-cd
Choose a base branch
from
Skenvy:workflows
base: new-ci-cd
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Workflows #41
Changes from 19 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
0644974
Add dependabot file
Skenvy 85706b8
Extensive gitignore
Skenvy dc82003
Into the wild blue yonder
9ab5d01
Add the missing runs-on in cql
bf7add4
Update the nodev from a lockv 1 to a lockv 2 version
b872431
Run tests in xvfb
4afecea
sudo apt
774ea6a
use the recommeneded "xvfb-maybe"
efc44c3
Clean make
0a3a5d5
Workflows pr scoped test (#2)
Skenvy 1789933
Update lock
c77c1ac
Add legacy peer deps to make setup
e24c3c8
Add the smaller testing scope to test
1255980
Merge branch 'main' into workflows
1e99219
Merge branch 'yoavbls:main' into workflows
Skenvy 215c516
Merge branch 'workflows' of github.com:Skenvy/pretty-ts-errors into w…
Skenvy a0b9de5
Merge branch 'main' into workflows
Skenvy 754e708
Roll make recipes into either themselves or package json scripts
0d1bfdd
Move the mac and win runners to a comment
Skenvy 2be4db5
Merge branch 'main' into workflows
Skenvy be064d1
Merge branch 'main' into workflows
6bf696d
Remove action sha pins
792af8b
Swap to major only versions
c245495
Emoji diff and lint in its own job
721b96c
Fix spelling
de8ae6e
format test wf
834f79a
minify ignore, add prepack
d18a17f
Include vsce test in test and add in a draft release
c4bc1d4
specify out as the file glob in package and rename *-tests in scripts
0f3d91c
Remove ts-loader
2b8ce82
Fix multi-artifact download paths in release find files
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 hidden or 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,10 @@ | ||
| version: 2 | ||
| updates: | ||
| - package-ecosystem: github-actions | ||
| directory: "/" | ||
| schedule: | ||
| interval: daily | ||
| - package-ecosystem: npm | ||
| directory: "/" | ||
| schedule: | ||
| interval: weekly |
This file contains hidden or 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,138 @@ | ||
| name: Build Release Publish | ||
| on: | ||
| push: | ||
| branches: | ||
| - 'main' | ||
| workflow_dispatch: | ||
| permissions: {} | ||
| defaults: | ||
| run: | ||
| shell: bash | ||
| env: | ||
| target_node_version: 18.12.1 | ||
| jobs: | ||
| # Gate the build -> release -> publish jobs with the test workflow. | ||
| test: | ||
| name: 🦂 CI | ||
| permissions: | ||
| actions: read | ||
| contents: read | ||
| security-events: write | ||
| uses: ./.github/workflows/test.yml | ||
| # 🛑 Check both whether the package's version field has changed, and if that | ||
| # version's value already exists in a known release, to determine if we should | ||
| # proceed with building and releasing. | ||
| workflow-conditions: | ||
| name: 🛑 Stop release collisions | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| version-file-changed: ${{ steps.version-file-check.outputs.version-file-changed }} | ||
| version-tag-exists: ${{ steps.version-tag-exists.outputs.version-tag-exists }} | ||
| steps: | ||
| - name: 🏁 Checkout | ||
| uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2 | ||
Skenvy marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| with: | ||
| fetch-depth: 2 | ||
| - name: Check if version files changed | ||
| id: version-file-check | ||
| run: | | ||
| export VERSION_FILE="package.json" | ||
| [ "$(git diff HEAD^1.. --name-only | grep -e "^$VERSION_FILE$")" == "$VERSION_FILE" ] && echo "version-file-changed=${{toJSON(true)}}" >> $GITHUB_OUTPUT || echo "version-file-changed=${{toJSON(false)}}" >> $GITHUB_OUTPUT | ||
| - name: Notify on version-file-check | ||
| run: echo "::Notice::version-file-changed is ${{ fromJSON(steps.version-file-check.outputs.version-file-changed) }}" | ||
| - name: Check if version specified in version file has not released. | ||
| id: version-tag-exists | ||
| run: | | ||
| git fetch --tags | ||
| export VER=$(grep package.json -e "\"version\":" | cut -d \" -f 4) | ||
| [ -z "$(git tag -l "v$VER")" ] && echo "version-tag-exists=${{toJSON(false)}}" >> $GITHUB_OUTPUT || echo "version-tag-exists=${{toJSON(true)}}" >> $GITHUB_OUTPUT | ||
| - name: Notify on version-tag-exists | ||
| run: echo "::Notice::version-tag-exists is ${{ fromJSON(steps.version-tag-exists.outputs.version-tag-exists) }}" | ||
| # We want to build release and publish automatically if "version-file-changed" | ||
| # is true on push. Or manually if workflow_dispatch. | ||
| # Both triggers need "version-tag-exists" is false. | ||
| build: | ||
| name: Build 🧱 | ||
| needs: [test, workflow-conditions] | ||
| if: >- | ||
| ${{ ((fromJSON(needs.workflow-conditions.outputs.version-file-changed) == true && github.event_name == 'push') || | ||
| github.event_name == 'workflow_dispatch') && fromJSON(needs.workflow-conditions.outputs.version-tag-exists) == false }} | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: 🏁 Checkout | ||
| uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2 | ||
| - name: 🟩 Set up Node | ||
| uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1 | ||
| with: | ||
| node-version: ${{ env.target_node_version }} | ||
| - name: 🧱 Install build dependencies | ||
| run: npm run setup | ||
| - name: 🧱 Build | ||
| run: npm pack | ||
| - name: 🆙 Upload dists | ||
| uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # v3.1.1 | ||
| with: | ||
| name: Package | ||
| path: pretty-ts-errors-*.tgz | ||
| if-no-files-found: error | ||
| release: | ||
| name: Release 🚰 | ||
| needs: [build] | ||
| permissions: | ||
| contents: write | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: 🏁 Checkout | ||
| uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2 | ||
| - name: 🆒 Download dists | ||
| uses: actions/download-artifact@9782bd6a9848b53b110e712e20e42d89988822b7 # v3.0.1 | ||
| with: | ||
| name: Package | ||
| - name: 🚰 Release | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| export VER=$(grep package.json -e "\"version\":" | cut -d \" -f 4) | ||
| gh release create v$VER "$(find . | grep -e pretty-ts-errors-*\.tgz)#Package" --generate-notes -t "v$VER" | ||
Skenvy marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| publish-github: | ||
| name: Publish GitHub 🐱👤 | ||
| needs: [release] | ||
| permissions: | ||
| packages: write | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: 🏁 Checkout | ||
| uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2 | ||
| - name: 🆒 Download dists | ||
| uses: actions/download-artifact@9782bd6a9848b53b110e712e20e42d89988822b7 # v3.0.1 | ||
| with: | ||
| name: Package | ||
| - name: 🟩 Set up Node | ||
| uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1 | ||
| with: | ||
| node-version: ${{ env.target_node_version }} | ||
| registry-url: 'https://npm.pkg.github.com' | ||
| - name: 📦 Publish | ||
| run: npm run workflow_publishsh | ||
Skenvy marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| env: | ||
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| publish-npm: | ||
| name: Publish NPM 🟥 | ||
| needs: [release] | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: 🏁 Checkout | ||
| uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2 | ||
| - name: 🆒 Download dists | ||
| uses: actions/download-artifact@9782bd6a9848b53b110e712e20e42d89988822b7 # v3.0.1 | ||
| with: | ||
| name: Package | ||
| - name: 🟩 Set up Node | ||
| uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1 | ||
| with: | ||
| node-version: ${{ env.target_node_version }} | ||
| registry-url: 'https://registry.npmjs.org' | ||
| - name: 📦 Publish | ||
| run: npm run workflow_publishsh | ||
Skenvy marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| env: | ||
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
This file contains hidden or 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,85 @@ | ||
| name: CI | ||
| on: | ||
| push: | ||
| branches-ignore: | ||
| - 'main' | ||
| pull_request: | ||
| branches: | ||
| - 'main' | ||
| workflow_call: | ||
| permissions: {} | ||
| defaults: | ||
| run: | ||
| shell: bash | ||
| env: | ||
| target_node_version: 18.12.1 | ||
| jobs: | ||
| # On a push to a non-trunk branch, do a "quick" test. | ||
| quick-test: | ||
| name: 🦂 Quick Test | ||
| if: ${{ github.event_name == 'push' && !(github.event.ref == 'refs/heads/main') }} | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: 🏁 Checkout | ||
| uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 | ||
| - name: 🟩 Set up Node | ||
| uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1 | ||
| with: | ||
| node-version: ${{ env.target_node_version }} | ||
| - name: 🧱 Install build dependencies | ||
| run: npm run setup | ||
| - name: 🦂 Test | ||
| run: npm run workflow_test | ||
| - name: 🧹 Lint | ||
| run: npm run lint | ||
Skenvy marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| # On a push to the trunk branch, or a PR (or manual dispatch), run the full | ||
| # set of all tests against the targeted supported major versions. | ||
| full-test: | ||
| name: 🦂 Full Test | ||
| if: >- | ||
| ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' || | ||
| (github.event_name == 'push' && github.event.ref == 'refs/heads/main') }} | ||
| runs-on: '${{ matrix.os }}' | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| version: ['16', '17', '18', '19'] | ||
Skenvy marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| os: [ubuntu-latest] # TODO: stabilise macOS-latest, windows-latest | ||
| steps: | ||
| - name: 🏁 Checkout | ||
| uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2 | ||
| - name: 🟩 Set up Node ${{ matrix.version }} | ||
| uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1 | ||
| with: | ||
| node-version: '${{ matrix.version }}' | ||
| - name: 🧱 Install build dependencies | ||
| run: npm run setup | ||
| - name: 🦂 Test | ||
| run: npm run workflow_test | ||
| - name: 🧹 Lint | ||
| run: npm run lint | ||
| # On a push to the trunk branch, or a PR (or manual dispatch), do a CodeQL analysis. | ||
| codeql: | ||
| name: 👨💻 CodeQL | ||
| if: >- | ||
| ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' || | ||
| (github.event_name == 'push' && github.event.ref == 'refs/heads/main') }} | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| actions: read | ||
| contents: read | ||
| security-events: write | ||
| steps: | ||
| - name: 🏁 Checkout | ||
| uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 | ||
| - name: 👨💻 Init CodeQL | ||
| uses: github/codeql-action/init@c3b6fce4ee2ca25bc1066aa3bf73962fda0e8898 # v2.1.31 | ||
| with: | ||
| languages: javascript | ||
| queries: +security-extended,security-and-quality | ||
| - name: 🧱 Autobuild | ||
| uses: github/codeql-action/autobuild@c3b6fce4ee2ca25bc1066aa3bf73962fda0e8898 # v2.1.31 | ||
| - name: 👨💻 Perform CodeQL Analysis | ||
| uses: github/codeql-action/analyze@c3b6fce4ee2ca25bc1066aa3bf73962fda0e8898 # v2.1.31 | ||
| with: | ||
| category: "/language:javascript" | ||
Skenvy marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or 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,139 @@ | ||
| ################################################################################ | ||
| # Adopt ignore rules from the recommended GH default for Node, from; | ||
| # https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore | ||
| ################################################################################ | ||
| # Logs | ||
| logs | ||
| *.log | ||
| npm-debug.log* | ||
| yarn-debug.log* | ||
| yarn-error.log* | ||
| lerna-debug.log* | ||
| .pnpm-debug.log* | ||
|
|
||
| # Diagnostic reports (https://nodejs.org/api/report.html) | ||
| report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json | ||
|
|
||
| # Runtime data | ||
| pids | ||
| *.pid | ||
| *.seed | ||
| *.pid.lock | ||
|
|
||
| # Directory for instrumented libs generated by jscoverage/JSCover | ||
| lib-cov | ||
|
|
||
| # Coverage directory used by tools like istanbul | ||
| coverage | ||
| *.lcov | ||
|
|
||
| # nyc test coverage | ||
| .nyc_output | ||
|
|
||
| # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) | ||
| .grunt | ||
|
|
||
| # Bower dependency directory (https://bower.io/) | ||
| bower_components | ||
|
|
||
| # node-waf configuration | ||
| .lock-wscript | ||
|
|
||
| # Compiled binary addons (https://nodejs.org/api/addons.html) | ||
| build/Release | ||
|
|
||
| # Dependency directories | ||
| node_modules/ | ||
| jspm_packages/ | ||
|
|
||
| # Snowpack dependency directory (https://snowpack.dev/) | ||
| web_modules/ | ||
|
|
||
| # TypeScript cache | ||
| *.tsbuildinfo | ||
|
|
||
| # Optional npm cache directory | ||
| .npm | ||
|
|
||
| # Optional eslint cache | ||
| .eslintcache | ||
|
|
||
| # Optional stylelint cache | ||
| .stylelintcache | ||
|
|
||
| # Microbundle cache | ||
| .rpt2_cache/ | ||
| .rts2_cache_cjs/ | ||
| .rts2_cache_es/ | ||
| .rts2_cache_umd/ | ||
|
|
||
| # Optional REPL history | ||
| .node_repl_history | ||
|
|
||
| # Output of 'npm pack' | ||
| *.tgz | ||
|
|
||
| # Yarn Integrity file | ||
| .yarn-integrity | ||
|
|
||
| # dotenv environment variable files | ||
| .env | ||
| .env.development.local | ||
| .env.test.local | ||
| .env.production.local | ||
| .env.local | ||
|
|
||
| # parcel-bundler cache (https://parceljs.org/) | ||
| .cache | ||
| .parcel-cache | ||
|
|
||
| # Next.js build output | ||
| .next | ||
| out | ||
|
|
||
| # Nuxt.js build / generate output | ||
| .nuxt | ||
| dist | ||
| node_modules | ||
| .vscode-test/ | ||
|
|
||
| # Gatsby files | ||
| .cache/ | ||
| # Comment in the public line in if your project uses Gatsby and not Next.js | ||
| # https://nextjs.org/blog/next-9-1#public-directory-support | ||
| # public | ||
|
|
||
| # vuepress build output | ||
| .vuepress/dist | ||
|
|
||
| # vuepress v2.x temp and cache directory | ||
| .temp | ||
| .cache | ||
|
|
||
| # Docusaurus cache and generated files | ||
| .docusaurus | ||
|
|
||
| # Serverless directories | ||
| .serverless/ | ||
|
|
||
| # FuseBox cache | ||
| .fusebox/ | ||
|
|
||
| # DynamoDB Local files | ||
| .dynamodb/ | ||
|
|
||
| # TernJS port file | ||
| .tern-port | ||
|
|
||
| # Stores VSCode versions used for testing VSCode extensions | ||
| .vscode-test | ||
|
|
||
| # yarn v2 | ||
| .yarn/cache | ||
| .yarn/unplugged | ||
| .yarn/build-state.yml | ||
| .yarn/install-state.gz | ||
| .pnp.* | ||
|
|
||
| ################################################################################ | ||
| # Additional ignore rules beyond the recommended. | ||
| ################################################################################ | ||
| *.vsix |
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.
Uh oh!
There was an error while loading. Please reload this page.