generated from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify the release process (no more build script or release branche…
…s) (#281) * Simplify the release process (no more build script or release branches) * Remove the `bin/` submodule * npm run pack * Use a different YAML syntax Co-authored-by: Curtis Vogt <[email protected]> * Use simpler (but equivalent) logic Co-authored-by: Curtis Vogt <[email protected]> * Fix a logic bug * Remove some job matrices Co-authored-by: Curtis Vogt <[email protected]> * Intentionally fail a job (to make sure that `finalize` thus also fails) * Revert "Intentionally fail a job (to make sure that `finalize` thus also fails)" This reverts commit cd7944c. --------- Co-authored-by: Curtis Vogt <[email protected]>
- Loading branch information
1 parent
54be0dc
commit a0a0978
Showing
12 changed files
with
38,635 additions
and
148 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,222 @@ | ||
name: PR Checks | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
tags: '*' | ||
concurrency: | ||
# Skip intermediate builds: all builds except for builds on the `master` branch | ||
# Cancel intermediate builds: only pull request builds | ||
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/master' || github.run_number }} | ||
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} | ||
permissions: | ||
contents: read | ||
jobs: | ||
finalize-pr-checks: | ||
if: always() # this line is important to keep the `finalize` job from being marked as skipped; do not change or delete this line | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
needs: | ||
- checked-in-files | ||
- build | ||
- npm-run-test | ||
- make-targets | ||
- stalecheck-npm-install | ||
steps: | ||
- run: | | ||
echo checked-in-files: ${{ needs.checked-in-files.result }} | ||
echo build: ${{ needs.build.result }} | ||
echo npm-run-test: ${{ needs.npm-run-test.result }} | ||
echo make-targets: ${{ needs.make-targets.result }} | ||
echo stalecheck-npm-install: ${{ needs.stalecheck-npm-install.result }} | ||
- run: exit 1 | ||
if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') }} | ||
checked-in-files: | ||
timeout-minutes: 30 | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
steps: | ||
### Check out the repo: | ||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 | ||
with: | ||
persist-credentials: false | ||
### Cleanall: | ||
- run: make cleanall | ||
### Install NodeJS | ||
# Unix (non-Windows): | ||
- uses: asdf-vm/actions/setup@05e0d2ed97b598bfce82fd30daf324ae0c4570e6 | ||
if: runner.os != 'Windows' | ||
- run: make unix-asdf-install | ||
if: runner.os != 'Windows' | ||
# Windows: | ||
# Windows does not support asdf, so we have to use `actions/setup-node` | ||
# to install asdf: | ||
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b | ||
if: runner.os == 'Windows' | ||
with: | ||
node-version-file: '.tool-versions' | ||
### Install the NodeJS packages that we depend on: | ||
- run: make install-packages | ||
### Print some debugging info: | ||
- name: Print the NodeJS version (for debugging) | ||
run: | | ||
which -a node | ||
node --version | ||
which -a npm | ||
npm --version | ||
### Build: | ||
- run: make pack | ||
### Clean (not cleanall!): | ||
- run: make clean | ||
### Make sure there are no uncommited changes | ||
- uses: julia-actions/setup-julia@780022b48dfc0c2c6b94cfee6a9284850107d037 | ||
with: | ||
version: '1' | ||
- run: git --no-pager status | ||
- run: git --no-pager diff | ||
- run: julia ./ci/check_uncommitted_changes.jl | ||
build: | ||
timeout-minutes: 30 | ||
runs-on: ubuntu-latest | ||
steps: | ||
### Check out the repo: | ||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 | ||
with: | ||
persist-credentials: false | ||
### Cleanall: | ||
- run: make cleanall | ||
### Install NodeJS | ||
# Unix (non-Windows): | ||
- uses: asdf-vm/actions/setup@05e0d2ed97b598bfce82fd30daf324ae0c4570e6 | ||
if: runner.os != 'Windows' | ||
- run: make unix-asdf-install | ||
if: runner.os != 'Windows' | ||
# Windows: | ||
# Windows does not support asdf, so we have to use `actions/setup-node` | ||
# to install asdf: | ||
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b | ||
if: runner.os == 'Windows' | ||
with: | ||
node-version-file: '.tool-versions' | ||
### Install the NodeJS packages that we depend on: | ||
- run: make install-packages | ||
### Print some debugging info: | ||
- name: Print the NodeJS version (for debugging) | ||
run: | | ||
which -a node | ||
node --version | ||
which -a npm | ||
npm --version | ||
### Build: | ||
- run: make build | ||
- run: make pack | ||
### Make sure some other `make` targets don't bitrot: | ||
- name: Run some other `make` targets to ensure that they don't bitrot | ||
run: | | ||
make clean | ||
make cleanall | ||
- name: Run all of the "cleaning" `make` targets to ensure that they don't bitrot | ||
run: | | ||
make clean | ||
make cleanall | ||
npm-run-test: | ||
timeout-minutes: 30 | ||
runs-on: ubuntu-latest | ||
steps: | ||
### Check out the repo: | ||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 | ||
with: | ||
persist-credentials: false | ||
### Cleanall: | ||
- run: make cleanall | ||
### Install NodeJS | ||
# Unix (non-Windows): | ||
- uses: asdf-vm/actions/setup@05e0d2ed97b598bfce82fd30daf324ae0c4570e6 | ||
if: runner.os != 'Windows' | ||
- run: make unix-asdf-install | ||
if: runner.os != 'Windows' | ||
# Windows: | ||
# Windows does not support asdf, so we have to use `actions/setup-node` | ||
# to install asdf: | ||
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b | ||
if: runner.os == 'Windows' | ||
with: | ||
node-version-file: '.tool-versions' | ||
### Install the NodeJS packages that we depend on: | ||
- run: make install-packages | ||
### Print some debugging info: | ||
- name: Print the NodeJS version (for debugging) | ||
run: | | ||
which -a node | ||
node --version | ||
which -a npm | ||
npm --version | ||
### Build: | ||
- run: make build | ||
- run: make test | ||
make-targets: # This is a job to make sure that none of the `make` targets bitrot | ||
timeout-minutes: 30 | ||
runs-on: ubuntu-latest | ||
steps: | ||
### Check out the repo: | ||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 | ||
with: | ||
persist-credentials: false | ||
### Cleanall: | ||
- run: make cleanall | ||
### Install NodeJS | ||
# Unix (non-Windows): | ||
- uses: asdf-vm/actions/setup@05e0d2ed97b598bfce82fd30daf324ae0c4570e6 | ||
if: runner.os != 'Windows' | ||
- run: make unix-asdf-install | ||
if: runner.os != 'Windows' | ||
### Install the NodeJS packages that we depend on: | ||
- run: make install-packages | ||
### Make sure some other `make` targets don't bitrot: | ||
- name: Run some other `make` targets to ensure that they don't bitrot | ||
run: | | ||
make unix-asdf-install | ||
make install-packages | ||
make build | ||
make pack | ||
make everything-from-scratch | ||
- name: Run all of the "cleaning" `make` targets to ensure that they don't bitrot | ||
run: | | ||
make clean | ||
make cleanall | ||
stalecheck-npm-install: | ||
# In this job, we are basically trying to check if `package-lock.json` is in | ||
# sync with `package-lock.json`. | ||
# | ||
# So, for example, if someone manually edits the `package.json` file, we want | ||
# to make sure that the `package-lock.json` file is not out of sync with the | ||
# `package.json` file. | ||
timeout-minutes: 30 | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
steps: | ||
### Check out the repo: | ||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 | ||
with: | ||
persist-credentials: false | ||
### Install NodeJS | ||
# Unix (non-Windows): | ||
- uses: asdf-vm/actions/setup@05e0d2ed97b598bfce82fd30daf324ae0c4570e6 | ||
if: runner.os != 'Windows' | ||
- run: make unix-asdf-install | ||
if: runner.os != 'Windows' | ||
### Run the master commands for this job: | ||
- run: make clean | ||
- run: npm ci | ||
# - run: npm install --package-lock-only | ||
- run: npm install | ||
### Make sure there are no uncommited changes | ||
- uses: julia-actions/setup-julia@780022b48dfc0c2c6b94cfee6a9284850107d037 | ||
with: | ||
version: '1' | ||
- run: git --no-pager status | ||
- run: git --no-pager diff | ||
- run: julia ./ci/check_uncommitted_changes.jl |
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,3 +1,2 @@ | ||
node_modules/ | ||
__tests__/runner/* | ||
dist/ |
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,3 +0,0 @@ | ||
[submodule "bin"] | ||
path = bin | ||
url = [email protected]:julia-actions/bin.git | ||
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,49 @@ | ||
.NOTPARALLEL: | ||
|
||
# This is the default target: | ||
.PHONY: pack | ||
pack: build | ||
npm run pack | ||
|
||
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | ||
|
||
.PHONY: everything-from-scratch | ||
everything-from-scratch: cleanall install-packages build pack clean | ||
|
||
# build does `npm run build`, but does not run `npm run pack` | ||
.PHONY: build | ||
build: | ||
npm run build | ||
|
||
.PHONY: test | ||
test: | ||
npm run test | ||
|
||
.PHONY: install-packages | ||
install-packages: | ||
rm -rf node_modules/ | ||
# Note: we use `npm ci` instead of `npm install`, because we want to make sure | ||
# that we respect the versions in the `package-lock.json` lockfile. | ||
npm ci | ||
|
||
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -rf node_modules/ | ||
|
||
.PHONY: cleanall | ||
cleanall: clean | ||
rm -rf lib/ | ||
rm -rf dist/ | ||
|
||
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | ||
|
||
# asdf does not support Windows. | ||
# On Windows, users need to install the correct version of NodeJS themselves. | ||
.PHONY: unix-asdf-install | ||
unix-asdf-install: | ||
asdf plugin add nodejs # update this list when we add more tools to `.tool-versions` | ||
asdf install | ||
|
||
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
Submodule bin
deleted from
0f674f
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 @@ | ||
const cmd = `git --no-pager diff --exit-code --stat` | ||
|
||
const proc = run(pipeline(cmd; stdin, stdout, stderr); wait = false) | ||
|
||
wait(proc) | ||
|
||
@info "" success(proc) proc.exitcode | ||
|
||
if !success(proc) | ||
recommended_cmd = "make everything-from-scratch" | ||
msg = "##[error] found changed files after build. " * | ||
"Please run `$(recommended_cmd)` and " * | ||
"then check in all changes." | ||
println(stderr, msg) | ||
exit(1) | ||
end |
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
Oops, something went wrong.