Skip to content
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

feat: update asdf repo if it exists #539

Merged
merged 21 commits into from
Mar 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,4 @@ jobs:
shell: bash
run: |
yarn build
if [ "$(git status --porcelain | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes after build. See status below:"
git diff
exit 1
fi
yarn build:check_uncommitted_changes
30 changes: 30 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,36 @@ jobs:
echo PATH="${PATH}"
asdf --version

asdf_updates_clone_if_installed:
strategy:
fail-fast: false
matrix:
os: ["macos-latest", "ubuntu-latest"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: "Setup: should clone repo"
uses: ./setup
- run: asdf version
- name:
"Simulate self-hosted runner and remove /home/runner/.asdf/bin/asdf
after setup (:shrug:)"
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
rm -rf /home/runner/.asdf/bin/asdf
- name:
"Simulate self-hosted runner and remove /Users/runner/.asdf/bin/asdf
after setup (:shrug:)"
if: ${{ matrix.os == 'macos-latest' }}
run: |
rm -rf /Users/runner/.asdf/bin/asdf
- name: "Setup: should update repo"
uses: ./setup
# NB: how is it that the hosted runners get to this point in the code without ~/.asdf/bin/asdf
# the below execution fails because the checkout doesn't seem to fix the rm -rf.
# Comment out for now & trust in the OP of #394
# - run: asdf version

plugin_is_tested:
strategy:
fail-fast: false
Expand Down
46 changes: 28 additions & 18 deletions install/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions lefthook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ pre-push:
run: yarn run lint
format:
run: yarn fmt:check
check_uncommitted_build_changes:
run: yarn build:check_uncommitted_changes

pre-commit:
commands:
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"fmt:check": "prettier --check .",
"typecheck": "tsc",
"lint": "eslint \"**/*.ts\" --cache",
"build": "esbuild src/install/main.ts src/plugin-test/main.ts src/plugins-add/main.ts src/setup/main.ts --bundle --outdir=. --target=node16 --platform=node"
"build": "esbuild src/install/main.ts src/plugin-test/main.ts src/plugins-add/main.ts src/setup/main.ts --bundle --outdir=. --target=node16 --platform=node",
"build:check_uncommitted_changes": "bash -c 'if [ $(git status --porcelain | grep --extended-regexp \"src|install|plugin-test|plugins-add\" | wc -l) -gt 0 ]; then printf \"* %s\\n\" \"Detected uncommitted changes after build. See status below:\"; git diff; exit 1; fi'"
},
"dependencies": {
"@actions/core": "^1.10.0",
Expand Down
40 changes: 25 additions & 15 deletions plugin-test/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 28 additions & 18 deletions plugins-add/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading