first commit
This commit is contained in:
69
.github/workflows/test.yml
vendored
Normal file
69
.github/workflows/test.yml
vendored
Normal file
@@ -0,0 +1,69 @@
|
||||
name: Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main, develop ]
|
||||
pull_request:
|
||||
branches: [ main, develop ]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
shell: [bash, zsh]
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y bash zsh curl jq bc bash-completion bats
|
||||
|
||||
- name: Make script executable
|
||||
run: chmod +x finishte.sh
|
||||
|
||||
- name: Run BATS tests
|
||||
run: |
|
||||
if [ -d tests ]; then
|
||||
bats tests/
|
||||
else
|
||||
echo "No tests directory found"
|
||||
fi
|
||||
|
||||
- name: Test installation
|
||||
run: |
|
||||
export HOME=$PWD/test-home
|
||||
mkdir -p $HOME/.local/bin
|
||||
cp finishte.sh $HOME/.local/bin/finishte
|
||||
chmod +x $HOME/.local/bin/finishte
|
||||
$HOME/.local/bin/finishte --help
|
||||
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install shellcheck
|
||||
run: sudo apt-get update && sudo apt-get install -y shellcheck
|
||||
|
||||
- name: Run shellcheck
|
||||
run: shellcheck finishte.sh docs/install.sh || true
|
||||
|
||||
docker:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Build Docker image
|
||||
run: docker build -t finish:test .
|
||||
|
||||
- name: Test Docker image
|
||||
run: |
|
||||
docker run --rm finish:test -c "finishte --help"
|
||||
Reference in New Issue
Block a user