Skip to content

Commit 35fd588

Browse files
author
Pablo Ramos
committed
feat: add GitHub Actions CI/CD workflow with tests and automatic releases
1 parent b152601 commit 35fd588

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/ci.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: CI/CD
2+
3+
on:
4+
push:
5+
branches: [main]
6+
tags: ["v*"]
7+
pull_request:
8+
branches: [main]
9+
10+
jobs:
11+
test:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: Install Zsh
16+
run: sudo apt-get update && sudo apt-get install -y zsh
17+
- name: Install Oh My Zsh
18+
run: |
19+
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
20+
- name: Setup plugin
21+
run: |
22+
mkdir -p ~/.oh-my-zsh/custom/plugins/venvswitch
23+
cp venvswitch.plugin.zsh ~/.oh-my-zsh/custom/plugins/venvswitch/
24+
echo 'plugins=(venvswitch)' >> ~/.zshrc
25+
- name: Check syntax
26+
run: zsh -n venvswitch.plugin.zsh
27+
- name: Test basic functionality
28+
run: |
29+
zsh -c 'source ~/.zshrc && venvswitch_config'
30+
- name: Install shellcheck
31+
run: sudo apt-get install -y shellcheck
32+
- name: Lint with shellcheck
33+
run: shellcheck venvswitch.plugin.zsh
34+
35+
release:
36+
if: startsWith(github.ref, 'refs/tags/v')
37+
needs: test
38+
runs-on: ubuntu-latest
39+
steps:
40+
- uses: actions/checkout@v4
41+
- name: Create Release
42+
uses: softprops/action-gh-release@v1
43+
with:
44+
generate_release_notes: true
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)