diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml new file mode 100644 index 0000000..fedbe0f --- /dev/null +++ b/.forgejo/workflows/ci.yml @@ -0,0 +1,55 @@ +name: ci + +on: + push: + paths: + - "back001/**" + - "front001/**" + - ".forgejo/workflows/**" + pull_request: + paths: + - "back001/**" + - "front001/**" + - ".forgejo/workflows/**" + +jobs: + backend: + runs-on: docker + # uruchamiaj backend tylko gdy zmiany dotyczą back001 lub workflowów + if: > + contains(join(github.event.head_commit.added, ' '), 'back001/') || + contains(join(github.event.head_commit.modified, ' '), 'back001/') || + contains(join(github.event.head_commit.removed, ' '), 'back001/') || + github.event_name == 'pull_request' + container: + image: gradle:8.7-jdk21 + steps: + - uses: actions/checkout@v4 + + - name: Test + build (backend) + # ważne: monorepo -> ustawiamy working dir + working-directory: back001 + run: | + ./gradlew test build --no-daemon + + flutter: + runs-on: docker + # uruchamiaj flutter tylko gdy zmiany dotyczą front001 lub workflowów + if: > + contains(join(github.event.head_commit.added, ' '), 'front001/') || + contains(join(github.event.head_commit.modified, ' '), 'front001/') || + contains(join(github.event.head_commit.removed, ' '), 'front001/') || + github.event_name == 'pull_request' + container: + image: ghcr.io/cirruslabs/flutter:stable + steps: + - uses: actions/checkout@v4 + + - name: Analyze + test (flutter) + working-directory: front001/mosenioring + run: | + flutter --version + flutter pub get + flutter analyze + flutter test +