diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 0000000..acebfa6 --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,29 @@ +name: CI + +on: + push: + pull_request: + +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: ruby/setup-ruby@v1 + with: + ruby-version: file # reads .ruby-version + bundler-cache: true + + - name: Ruby syntax check + run: find app.rb config lib -name "*.rb" -print0 | xargs -0 -n1 ruby -c + + - name: App loads without errors + run: bundle exec ruby -e 'require_relative "app"' + + - uses: actions/setup-node@v4 + with: + node-version: "22" + + - name: JS syntax check + run: find public/js -name "*.js" -print0 | xargs -0 -n1 node --check diff --git a/docs/development.adoc b/docs/development.adoc index c802ddd..d21cd58 100644 --- a/docs/development.adoc +++ b/docs/development.adoc @@ -90,3 +90,11 @@ gpsd -N -n tcp://127.0.0.1:5001 `GET /api/gnss/position` should then report the fake fix (Bratislava Castle, in the sentences above) within a couple of seconds. + +== Continuous integration + +`.gitea/workflows/ci.yml` runs on every push/PR against a self-hosted +Gitea Actions runner: `ruby -c` on every `.rb` file, a `require_relative +"app"` smoke check that the app loads without error, and `node --check` +on every file under `public/js/`. There is no test suite yet — these +are cheap syntax/load checks, not behavioral tests.