Skip to content

Commit

Permalink
feat: update asdf repo if it exists (#539)
Browse files Browse the repository at this point in the history
Co-authored-by: Sakamoto, Kazunori <exkazuu@gmail.com>
  • Loading branch information
jthegedus and exKAZUu committed Mar 17, 2023
1 parent ea2f7d9 commit 4907cdf
Show file tree
Hide file tree
Showing 9 changed files with 164 additions and 82 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/build.yml
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
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
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
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.

0 comments on commit 4907cdf

Please sign in to comment.