diff --git a/.github/renovate-bot-config.json b/.github/renovate-bot-config.json new file mode 100644 index 000000000..fdd9ee04d --- /dev/null +++ b/.github/renovate-bot-config.json @@ -0,0 +1,8 @@ +{ + "branchPrefix": "renovate-fix/", + "gitAuthor": "Renovate Bot ", + "platform": "github", + "repositories": [ + "solita/etp-core" + ] +} diff --git a/.github/workflows/ci-backend.yml b/.github/workflows/ci-backend.yml new file mode 100644 index 000000000..233ee28a5 --- /dev/null +++ b/.github/workflows/ci-backend.yml @@ -0,0 +1,76 @@ +name: ci + +on: + pull_request: + push: + branches: + - develop + +jobs: + build: + runs-on: ubuntu-latest + defaults: + run: + working-directory: etp-core/etp-backend + + steps: + - uses: actions/checkout@v3 + - name: Prepare java + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '17' + - name: Install clojure tools + uses: DeLaGuardo/setup-clojure@10.3 + with: + cli: 1.11.1.1273 + - name: Build + run: clojure -M:uberjar + + lint: + runs-on: ubuntu-latest + defaults: + run: + working-directory: etp-core/etp-backend + + steps: + - uses: actions/checkout@v3 + - name: Prepare java + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '17' + - name: Install clojure tools + uses: DeLaGuardo/setup-clojure@10.3 + with: + cli: 1.11.1.1273 + - name: Lint + run: clojure -M:lint --fail-level error + + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Prepare java + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '17' + - name: Install clojure tools + uses: DeLaGuardo/setup-clojure@10.3 + with: + cli: 1.11.1.1273 + - name: Install Libreoffice + run: sudo apt-get update && sudo apt-get install libreoffice + - name: Docker Compose + working-directory: etp-core/docker + run: ./start.sh + - name: Test + working-directory: etp-core/etp-backend + run: clojure -M:dev:test-ci + - name: Publish Test Report + uses: mikepenz/action-junit-report@v3 + if: success() || failure() + with: + report_paths: 'etp-backend/target/test.xml' \ No newline at end of file diff --git a/.github/workflows/ci-frontend.yml b/.github/workflows/ci-frontend.yml new file mode 100644 index 000000000..d7fc8cbe7 --- /dev/null +++ b/.github/workflows/ci-frontend.yml @@ -0,0 +1,92 @@ +# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: Node.js CI + +on: + push: + branches: [ develop ] + pull_request: + branches: [ develop ] + +jobs: + build: + runs-on: ubuntu-latest + defaults: + run: + working-directory: etp-front + strategy: + matrix: + node-version: [ 18.x, 20.x ] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - run: npm ci + - run: npm run build --if-present + + test: + runs-on: ubuntu-latest + defaults: + run: + working-directory: etp-front + strategy: + matrix: + node-version: [ 18.x, 20.x ] + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - run: npm ci + - run: npm test + + format: + runs-on: ubuntu-latest + defaults: + run: + working-directory: etp-front + strategy: + matrix: + node-version: [ 18.x, 20.x ] + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - run: npm ci + - run: npm run check-format + + storybook: + runs-on: ubuntu-latest + defaults: + run: + working-directory: etp-front + strategy: + matrix: + node-version: [ 18.x, 20.x ] + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - run: npm ci + - run: npm run storybook:build \ No newline at end of file diff --git a/.github/workflows/ci-public.yml b/.github/workflows/ci-public.yml new file mode 100644 index 000000000..fff40d1da --- /dev/null +++ b/.github/workflows/ci-public.yml @@ -0,0 +1,53 @@ +# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: Node.js CI + +on: + push: + branches: [ develop ] + pull_request: + branches: [ develop ] + +jobs: + build: + runs-on: ubuntu-latest + defaults: + run: + working-directory: etp-public + strategy: + matrix: + node-version: [ 18.x, 20.x ] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - run: npm ci + - run: npm run build --if-present + - run: npm run check-format + + format: + runs-on: ubuntu-latest + defaults: + run: + working-directory: etp-public + strategy: + matrix: + node-version: [ 18.x, 20.x ] + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - run: npm ci + - run: npm run check-format \ No newline at end of file diff --git a/.github/workflows/nvd-clojure.yml b/.github/workflows/nvd-clojure.yml new file mode 100644 index 000000000..6f0e503bc --- /dev/null +++ b/.github/workflows/nvd-clojure.yml @@ -0,0 +1,24 @@ +name: nvd-clojure + +on: + schedule: + - cron: '0 2 * * 1' + +jobs: + nvd: + runs-on: ubuntu-latest + defaults: + run: + working-directory: etp-core/etp-backend + container: + image: clojure:openjdk-17-tools-deps + + steps: + - uses: actions/checkout@v3 + - name: Run nvd + run: ./nvd.sh + - name: Publish Test Report + uses: mikepenz/action-junit-report@v3 + if: success() || failure() + with: + report_paths: 'etp-backend/target/nvd/dependency-check-junit.xml' \ No newline at end of file diff --git a/.github/workflows/renovate.yml b/.github/workflows/renovate.yml new file mode 100644 index 000000000..00196ecaa --- /dev/null +++ b/.github/workflows/renovate.yml @@ -0,0 +1,19 @@ +name: renovate + +on: + schedule: + - cron: '10 0/1 * * *' # Start at ten past to avoid rush hour + +jobs: + renovate: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3.5.3 + - name: Self-hosted Renovate + uses: renovatebot/github-action@v39.0.1 + with: + token: ${{ secrets.RENOVATE_TOKEN }} + configurationFile: .github/renovate-bot-config.json + env: + LOG_LEVEL: 'debug'