From 48c89df8acfe32db212e7fa89b1f633f043526d2 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Thu, 7 Dec 2023 17:09:12 +0100 Subject: [PATCH] define all backend workflows --- .github/.remarkignore | 1 + .github/file-filters.yml | 14 ++++++++ .github/workflows/backend.deploy.docs.yml | 21 ++++++++++++ .github/workflows/backend.test.build.code.yml | 34 +++++++++++++++++++ .github/workflows/backend.test.build.docs.yml | 34 +++++++++++++++++++ .github/workflows/backend.test.lint.code.yml | 34 +++++++++++++++++++ .github/workflows/backend.test.unit.code.yml | 34 +++++++++++++++++++ 7 files changed, 172 insertions(+) create mode 100644 .github/.remarkignore create mode 100644 .github/file-filters.yml create mode 100644 .github/workflows/backend.deploy.docs.yml create mode 100644 .github/workflows/backend.test.build.code.yml create mode 100644 .github/workflows/backend.test.build.docs.yml create mode 100644 .github/workflows/backend.test.lint.code.yml create mode 100644 .github/workflows/backend.test.unit.code.yml diff --git a/.github/.remarkignore b/.github/.remarkignore new file mode 100644 index 0000000..f59ec20 --- /dev/null +++ b/.github/.remarkignore @@ -0,0 +1 @@ +* \ No newline at end of file diff --git a/.github/file-filters.yml b/.github/file-filters.yml new file mode 100644 index 0000000..43bc6cd --- /dev/null +++ b/.github/file-filters.yml @@ -0,0 +1,14 @@ +# These file filter patterns are used by the action https://github.com/dorny/paths-filter + +backend-test-lint-code: &backend-test-lint-code + - '**/*' + +backend-test-unit-code: &backend-test-unit-code + - '**/*' + +backend-test-build-code: &backend-test-build-code + - '**/*' + +backend-test-build-docs: &backend-test-build-docs + - '**/*.md' + - '.vuepress/*' \ No newline at end of file diff --git a/.github/workflows/backend.deploy.docs.yml b/.github/workflows/backend.deploy.docs.yml new file mode 100644 index 0000000..846733c --- /dev/null +++ b/.github/workflows/backend.deploy.docs.yml @@ -0,0 +1,21 @@ +name: "backend:deploy:docs to github" +on: + push: + branches: + - master +jobs: + build-and-deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@master + + - name: vuepress-deploy + uses: jenkey2011/vuepress-deploy@master + env: + ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} + #TARGET_REPO: username/repo + #TARGET_BRANCH: master + BUILD_SCRIPT: npm install && npm run docs:build + BUILD_DIR: build/docs/ + VUEPRESS_BASE: "boilerplate-backend" \ No newline at end of file diff --git a/.github/workflows/backend.test.build.code.yml b/.github/workflows/backend.test.build.code.yml new file mode 100644 index 0000000..f57ece5 --- /dev/null +++ b/.github/workflows/backend.test.build.code.yml @@ -0,0 +1,34 @@ +name: "backend:test:build test code" + +on: push + +jobs: + # only (but most important) job from this workflow required for pull requests + # check results serve as run conditions for all other jobs here + files-changed: + name: Detect File Changes - backend-test-build-code + runs-on: ubuntu-latest + outputs: + changes: ${{ steps.changes.outputs.backend-test-build-code }} + steps: + - uses: actions/checkout@v3.3.0 + + - name: Check for backend file changes + uses: dorny/paths-filter@v2.11.1 + id: changes + with: + token: ${{ github.token }} + filters: .github/file-filters.yml + list-files: shell + + build: + if: needs.files-changed.outputs.changes == 'true' + name: Build - Backend + needs: files-changed + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Backend | Build + run: npm install && npm run build \ No newline at end of file diff --git a/.github/workflows/backend.test.build.docs.yml b/.github/workflows/backend.test.build.docs.yml new file mode 100644 index 0000000..7f830c8 --- /dev/null +++ b/.github/workflows/backend.test.build.docs.yml @@ -0,0 +1,34 @@ +name: "backend:test:build test docs" + +on: push + +jobs: + # only (but most important) job from this workflow required for pull requests + # check results serve as run conditions for all other jobs here + files-changed: + name: Detect File Changes - backend-test-build-docs + runs-on: ubuntu-latest + outputs: + changes: ${{ steps.changes.outputs.backend-test-build-docs }} + steps: + - uses: actions/checkout@v3.3.0 + + - name: Check for backend file changes + uses: dorny/paths-filter@v2.11.1 + id: changes + with: + token: ${{ github.token }} + filters: .github/file-filters.yml + list-files: shell + + build: + if: needs.files-changed.outputs.changes == 'true' + name: Build Docs - Backend + needs: files-changed + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Backend | Build Docs + run: npm install && npm run docs:build \ No newline at end of file diff --git a/.github/workflows/backend.test.lint.code.yml b/.github/workflows/backend.test.lint.code.yml new file mode 100644 index 0000000..a05bb47 --- /dev/null +++ b/.github/workflows/backend.test.lint.code.yml @@ -0,0 +1,34 @@ +name: "backend:test:lint code with defined linters" + +on: push + +jobs: + # only (but most important) job from this workflow required for pull requests + # check results serve as run conditions for all other jobs here + files-changed: + name: Detect File Changes - backend-test-lint-code + runs-on: ubuntu-latest + outputs: + changes: ${{ steps.changes.outputs.backend-test-lint-code }} + steps: + - uses: actions/checkout@v3.3.0 + + - name: Check for backend file changes + uses: dorny/paths-filter@v2.11.1 + id: changes + with: + token: ${{ github.token }} + filters: .github/file-filters.yml + list-files: shell + + lint: + if: needs.files-changed.outputs.changes == 'true' + name: Lint - Backend + needs: files-changed + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Backend | Lint + run: npm install && npm run test:lint \ No newline at end of file diff --git a/.github/workflows/backend.test.unit.code.yml b/.github/workflows/backend.test.unit.code.yml new file mode 100644 index 0000000..bfabf40 --- /dev/null +++ b/.github/workflows/backend.test.unit.code.yml @@ -0,0 +1,34 @@ +name: "backend:test:unit test code with defined suites" + +on: push + +jobs: + # only (but most important) job from this workflow required for pull requests + # check results serve as run conditions for all other jobs here + files-changed: + name: Detect File Changes - backend-test-unit-code + runs-on: ubuntu-latest + outputs: + changes: ${{ steps.changes.outputs.backend-test-unit-code }} + steps: + - uses: actions/checkout@v3.3.0 + + - name: Check for backend file changes + uses: dorny/paths-filter@v2.11.1 + id: changes + with: + token: ${{ github.token }} + filters: .github/file-filters.yml + list-files: shell + + unit: + if: needs.files-changed.outputs.changes == 'true' + name: Unit - Backend + needs: files-changed + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Backend | Unit + run: npm install && npm run test:unit \ No newline at end of file