test: integration tests and vhs testing prepared #41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| ci: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: '25' | |
| - uses: DeLaGuardo/setup-clojure@13.4 | |
| with: | |
| cli: latest | |
| bb: latest | |
| clj-kondo: latest | |
| cljfmt: latest | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.m2/repository | |
| ~/.gitlibs | |
| key: deps-${{ hashFiles('deps.edn') }} | |
| restore-keys: deps- | |
| - name: Format check | |
| run: cljfmt check | |
| - name: Lint | |
| run: clj-kondo --fail-level error --lint src test | |
| - name: Test | |
| run: clojure -M:test | |
| - name: Test bb | |
| run: | | |
| bash <(curl https://raw.githubusercontent.com/babashka/babashka/master/install) --dev-build --dir /tmp | |
| /tmp/bb test:bb | |
| - name: Run vhs | |
| run: | | |
| sudo apt-get -qq update | |
| sudo apt-get -qq install -y ffmpeg ttyd | |
| go install github.com/charmbracelet/vhs@v0.10.0 | |
| cd docs/examples/ | |
| ${HOME}/go/bin/vhs vhs/pomodoro.tape | |
| ${HOME}/go/bin/vhs vhs/download.tape | |
| - name: Build JAR | |
| run: clojure -T:build jar | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: charm-jar | |
| path: target/ | |
| release: | |
| needs: ci | |
| if: github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: '25' | |
| - uses: DeLaGuardo/setup-clojure@13.4 | |
| with: | |
| cli: latest | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.m2/repository | |
| ~/.gitlibs | |
| key: deps-${{ hashFiles('deps.edn') }} | |
| restore-keys: deps- | |
| - name: Restore artifact | |
| uses: actions/download-artifact@v5 | |
| with: | |
| name: charm-jar | |
| path: target/ | |
| - name: Deploy to Clojars | |
| run: clojure -T:build deploy | |
| env: | |
| CLOJARS_USERNAME: ${{ secrets.CLOJARS_USERNAME }} | |
| CLOJARS_PASSWORD: ${{ secrets.CLOJARS_PASSWORD }} | |
| - name: Tag release | |
| env: | |
| GIT_COMMITTER_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }} | |
| run: | | |
| git config set user.name "Timo Kramer" | |
| git config set user.email GIT_COMMITTER_EMAIL | |
| clojure -T:build tag-release |