From 07454029bd67239ce42aaa68b427fbbe8e428e7d Mon Sep 17 00:00:00 2001 From: Andrew Xie <62098008+axieax@users.noreply.github.com> Date: Fri, 21 Apr 2023 16:59:58 +1000 Subject: feat(starship): create plugin (#10947) Co-authored-by: Carlo Sala --- .github/CODEOWNERS | 1 + 1 file changed, 1 insertion(+) (limited to '.github') diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 6668cd7ce..599b765ca 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -9,3 +9,4 @@ plugins/shell-proxy/ @septs plugins/universalarchive/ @Konfekt plugins/wp-cli/ @joshmedeski plugins/zoxide/ @ajeetdsouza +plugins/starship/ @axieax -- cgit v1.2.3-70-g09d2 From 5d3e86e2a48adf7a308773f8f1b725d187c7c5ef Mon Sep 17 00:00:00 2001 From: Miguel Sempere Date: Fri, 21 Apr 2023 08:15:31 +0100 Subject: feat(dbt): create plugin (#11635) Co-authored-by: Carlo Sala --- .github/CODEOWNERS | 1 + plugins/dbt/README.md | 29 +++++++++++++++++++++++++++++ plugins/dbt/dbt.plugin.zsh | 23 +++++++++++++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 plugins/dbt/README.md create mode 100644 plugins/dbt/dbt.plugin.zsh (limited to '.github') diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 599b765ca..0c5f3acee 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -10,3 +10,4 @@ plugins/universalarchive/ @Konfekt plugins/wp-cli/ @joshmedeski plugins/zoxide/ @ajeetdsouza plugins/starship/ @axieax +plugins/dbt/ @msempere diff --git a/plugins/dbt/README.md b/plugins/dbt/README.md new file mode 100644 index 000000000..e05d79cc3 --- /dev/null +++ b/plugins/dbt/README.md @@ -0,0 +1,29 @@ +# dbt plugin + +## Introduction + +The `dbt plugin` adds several aliases for useful [dbt](https://docs.getdbt.com/) commands and +[aliases](#aliases). + +To use it, add `dbt` to the plugins array of your zshrc file: + +``` +plugins=(... dbt) +``` + +## Aliases + +| Alias | Command | Description | +| ------ | ------------------------------------------------ | ---------------------------------------------------- | +| dbtlm | `dbt ls -s state:modified` | List modified models only | +| dbtrm | `dbt run -s state:modified` | Run modified models only | +| dbttm | `dbt test -m state:modified` | Test modified models only | +| dbtrtm | `dbtrm && dbttm` | Run and test modified models only | +| dbtrs | `dbt clean; dbt deps; dbt seed` | Re-seed data | +| dbtfrt | `dbtrs; dbt run --full-refresh; dbt test` | Perform a full fresh run with tests | +| dbtcds | `dbt docs generate; dbt docs serve` | Generate docs without compiling | +| dbtds | `dbt docs generate --no-compile; dbt docs serve` | Generate and serve docs skipping doc. re-compilation | + +## Maintainer + +### [msempere](https://github.com/msempere) diff --git a/plugins/dbt/dbt.plugin.zsh b/plugins/dbt/dbt.plugin.zsh new file mode 100644 index 000000000..6fcc2eecf --- /dev/null +++ b/plugins/dbt/dbt.plugin.zsh @@ -0,0 +1,23 @@ +# list modified models only +alias dbtlm="dbt ls -s state:modified" + +# run modified models only +alias dbtrm="dbt run -s state:modified" + +# test modified models only +alias dbttm="dbt test -m state:modified" + +# run and test modified models only +alias dbtrtm="dbtrm && dbttm" + +# re-seed data +alias dbtrs="dbt clean; dbt deps; dbt seed" + +# perform a full fresh run with tests +alias dbtfrt="dbtrs; dbt run --full-refresh; dbt test" + +# generate and serve docs +alias dbtcds="dbt docs generate; dbt docs serve" + +# generate and serve docs skipping doc. re-compilation +alias dbtds="dbt docs generate --no-compile; dbt docs serve" -- cgit v1.2.3-70-g09d2 From 6101106916147b1716ff2d5de4a53260e7607bae Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Fri, 2 Jun 2023 21:37:48 +0200 Subject: feat(install): deploy installer to install.ohmyz.sh (#11722) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Marc Cornellà --- .github/workflows/installer.yml | 55 +++++++++++++++++++++++++++++++ .github/workflows/installer/.gitignore | 1 + .github/workflows/installer/.vercelignore | 2 ++ .github/workflows/installer/vercel.json | 14 ++++++++ .github/workflows/main.yml | 2 -- 5 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/installer.yml create mode 100644 .github/workflows/installer/.gitignore create mode 100644 .github/workflows/installer/.vercelignore create mode 100644 .github/workflows/installer/vercel.json (limited to '.github') diff --git a/.github/workflows/installer.yml b/.github/workflows/installer.yml new file mode 100644 index 000000000..ac88d10b0 --- /dev/null +++ b/.github/workflows/installer.yml @@ -0,0 +1,55 @@ +name: Test and Deploy installer +on: + workflow_dispatch: {} + push: + paths: + - tools/install.sh + - .github/workflows/installer + - .github/workflows/installer.yml + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: false + +permissions: + contents: read # to checkout + +jobs: + test: + name: Test installer + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: + - ubuntu-latest + - macos-latest + steps: + - name: Set up git repository + uses: actions/checkout@v3 + - name: Install zsh + if: runner.os == 'Linux' + run: sudo apt-get update; sudo apt-get install zsh + - name: Test installer + run: sh ./tools/install.sh + + deploy: + name: Deploy installer in install.ohmyz.sh + if: github.ref == 'refs/heads/master' + runs-on: ubuntu-latest + environment: vercel + needs: + - test + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Install Vercel CLI + run: npm install -g vercel + - name: Setup project and deploy + env: + VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} + VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} + run: | + cp tools/install.sh .github/workflows/installer/install.sh + cd .github/workflows/installer + vc link --yes -t ${{ secrets.VERCEL_TOKEN }} + vc deploy --prod -t ${{ secrets.VERCEL_TOKEN }} diff --git a/.github/workflows/installer/.gitignore b/.github/workflows/installer/.gitignore new file mode 100644 index 000000000..f66fce310 --- /dev/null +++ b/.github/workflows/installer/.gitignore @@ -0,0 +1 @@ +install.sh diff --git a/.github/workflows/installer/.vercelignore b/.github/workflows/installer/.vercelignore new file mode 100644 index 000000000..41b233364 --- /dev/null +++ b/.github/workflows/installer/.vercelignore @@ -0,0 +1,2 @@ +/* +!/install.sh diff --git a/.github/workflows/installer/vercel.json b/.github/workflows/installer/vercel.json new file mode 100644 index 000000000..8c5aec5e0 --- /dev/null +++ b/.github/workflows/installer/vercel.json @@ -0,0 +1,14 @@ +{ + "headers": [ + { + "source": "/((?!favicon.ico).*)", + "headers": [{ "key": "Content-Type", "value": "text/plain" }] + } + ], + "rewrites": [ + { + "source": "/((?!favicon.ico|install.sh).*)", + "destination": "/install.sh" + } + ] +} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8ee2df3d8..57403629c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,8 +31,6 @@ jobs: - name: Install zsh if: runner.os == 'Linux' run: sudo apt-get update; sudo apt-get install zsh - - name: Test installer - run: sh ./tools/install.sh - name: Check syntax run: | for file in ./oh-my-zsh.sh \ -- cgit v1.2.3-70-g09d2 From cdd7dab5db4c668b962f908b57e244aa1ff4b574 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Sun, 17 Sep 2023 16:20:46 +0200 Subject: ci(installer): remove `vc link` which generates the wrong project `vc link` is not needed, as we already have `VERCEL_PROJECT_ID` defined as an env variable. Currently the `vc link` only creates a second empty project with the name `installer` as seen in logs: Linked to ohmyzsh/installer (created .vercel and added it to .gitignore) Vercel CLI 32.2.4 --- .github/workflows/installer.yml | 1 - 1 file changed, 1 deletion(-) (limited to '.github') diff --git a/.github/workflows/installer.yml b/.github/workflows/installer.yml index ac88d10b0..4a25c8079 100644 --- a/.github/workflows/installer.yml +++ b/.github/workflows/installer.yml @@ -51,5 +51,4 @@ jobs: run: | cp tools/install.sh .github/workflows/installer/install.sh cd .github/workflows/installer - vc link --yes -t ${{ secrets.VERCEL_TOKEN }} vc deploy --prod -t ${{ secrets.VERCEL_TOKEN }} -- cgit v1.2.3-70-g09d2 From 408330e131110c8b86ce60ab0492b35657cb4d57 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Wed, 11 Oct 2023 20:44:46 +0200 Subject: ci: remove redundant macos runner for CI tests Currently the macOS runner is not needed, as we are only checking zsh syntax. We can reactivate it in the future if needed. --- .github/workflows/main.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to '.github') diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 57403629c..de7d98262 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,16 +20,12 @@ permissions: jobs: tests: name: Run tests - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest if: github.repository == 'ohmyzsh/ohmyzsh' - strategy: - matrix: - os: [ubuntu-latest, macos-latest] steps: - name: Set up git repository uses: actions/checkout@v3 - name: Install zsh - if: runner.os == 'Linux' run: sudo apt-get update; sudo apt-get install zsh - name: Check syntax run: | -- cgit v1.2.3-70-g09d2 From 7348d12f8e5cd755037aa6f5d347eab0ac2efb0b Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Sat, 28 Oct 2023 10:24:24 +0200 Subject: ci(vercel): add Content-Disposition header on installer This allows doing something like curl -O https://install.ohmyz.sh and have the `install.sh` file automatically saved to its right name. --- .github/workflows/installer/vercel.json | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to '.github') diff --git a/.github/workflows/installer/vercel.json b/.github/workflows/installer/vercel.json index 8c5aec5e0..524dc3c0f 100644 --- a/.github/workflows/installer/vercel.json +++ b/.github/workflows/installer/vercel.json @@ -2,7 +2,16 @@ "headers": [ { "source": "/((?!favicon.ico).*)", - "headers": [{ "key": "Content-Type", "value": "text/plain" }] + "headers": [ + { + "key": "Content-Type", + "value": "text/plain" + }, + { + "key": "Content-Disposition", + "value": "inline; filename=\"install.sh\"" + } + ] } ], "rewrites": [ -- cgit v1.2.3-70-g09d2 From 7733e3ab57ee3f666cf6f3e699d03b69aca2d373 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Sat, 28 Oct 2023 10:29:54 +0200 Subject: ci: fix path filtering in installer workflow See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-including-and-excluding-paths --- .github/workflows/installer.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to '.github') diff --git a/.github/workflows/installer.yml b/.github/workflows/installer.yml index 4a25c8079..a70c483d1 100644 --- a/.github/workflows/installer.yml +++ b/.github/workflows/installer.yml @@ -3,9 +3,9 @@ on: workflow_dispatch: {} push: paths: - - tools/install.sh - - .github/workflows/installer - - .github/workflows/installer.yml + - 'tools/install.sh' + - '.github/workflows/installer/**' + - '.github/workflows/installer.yml' concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} -- cgit v1.2.3-70-g09d2