From 83d58748600daeb5eb98b1a53660981bb4a665d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Kilchenmann?= Date: Thu, 2 Sep 2021 09:05:11 +0200 Subject: [PATCH] refactor(gh-ci): split workflow tasks (#515) * refactor(gh-ci): delete release-drafter * refactor(gh-ci): split workflow tasks * refactor(gh-ci): split workflow tasks * refactor(gh-ci): split workflow tasks * refactor(gh-ci): split workflow tasks * refactor(gh-ci): split workflow tasks --- .github/release-drafter.yml | 44 --------------- .github/workflows/main.yml | 106 +++++++++++++++++++++++++++--------- 2 files changed, 80 insertions(+), 70 deletions(-) delete mode 100644 .github/release-drafter.yml diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml deleted file mode 100644 index e45483d318..0000000000 --- a/.github/release-drafter.yml +++ /dev/null @@ -1,44 +0,0 @@ -name-template: 'Next release' -tag-template: 'next-release' -categories: - - title: 'Breaking changes' - labels: - - 'breaking/api' - - 'breaking' - - title: 'Enhancements' - labels: - - 'feature' - - 'enhancement' - - title: 'Styling' - label: 'styling' - - title: 'Bug fixes' - labels: - - 'fix' - - 'bugfix' - - 'bug' - - title: 'Documentation' - label: 'documentation' - - title: 'Dependencies' - label: 'dependencies' - - title: 'Maintenance' - labels: - - 'chore' - - 'refactor' - - title: 'Testing' - label: 'testing' -change-template: '- #$NUMBER $TITLE' -change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks. -version-resolver: - major: - labels: - - 'major' - minor: - labels: - - 'minor' - patch: - labels: - - 'patch' - default: patch -template: | - - $CHANGES diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1fedda7f89..9e44a1d8ff 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,6 @@ name: CI +env: + NV: 12.x # node version on: push: @@ -6,42 +8,90 @@ on: types: [published] jobs: - build-test: - name: Build and Test + + find-ignored-tests: + name: Find ignored tests + runs-on: ubuntu-latest + steps: + - name: Checkout source + uses: actions/checkout@v2 + - name: Run the script + run: ./find-ignored-tests.sh + + unit-tests: + name: Run unit tests + needs: [find-ignored-tests] runs-on: ubuntu-latest - strategy: - matrix: - node-version: [12.x] steps: - - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} + - name: Checkout source + uses: actions/checkout@v2 + - name: Set up Node.js ${{ env.NV }} uses: actions/setup-node@v1 with: - node-version: ${{ matrix.node-version }} + node-version: ${{ env.NV }} - name: Install dependencies run: npm install - - name: Build app in prod mode - run: npm run build-prod - - name: Find ignored tests - run: ./find-ignored-tests.sh - - name: Run unit tests + - name: Run the tests run: npm run test-ci env: TZ: Europe/Zurich - - name: Run e2e tests - run: | - npm run webdriver-update - npm run test-e2e-protractor - - name: Run lint + + e2e-tests: + name: Run e2e tests + needs: [find-ignored-tests] + runs-on: ubuntu-latest + steps: + - name: Checkout source + uses: actions/checkout@v2 + - name: Set up Node.js ${{ env.NV }} + uses: actions/setup-node@v1 + with: + node-version: ${{ env.NV }} + - name: Install dependencies + run: npm install + - name: Webdriver update + run: npm run webdriver-update + - name: Run the tests + run: npm run test-e2e-protractor + + lint: + name: Run lint + runs-on: ubuntu-latest + steps: + - name: Checkout source + uses: actions/checkout@v2 + - name: Set up Node.js ${{ env.NV }} + uses: actions/setup-node@v1 + with: + node-version: ${{ env.NV }} + - name: Install dependencies + run: npm install + - name: Run the script run: npm run lint-ci + build: + name: Build the app + runs-on: ubuntu-latest + steps: + - name: Checkout source + uses: actions/checkout@v2 + - name: Set up Node.js ${{ env.NV }} + uses: actions/setup-node@v1 + with: + node-version: ${{ env.NV }} + - name: Install dependencies + run: npm install + - name: Build in prod mode + run: npm run build-prod + release-please: name: Prepare next release runs-on: ubuntu-latest # Automate releases with Conventional Commit Messages as Pull Requests are merged into "main" branch if: github.ref == 'refs/heads/main' steps: - - uses: GoogleCloudPlatform/release-please-action@v2 + - name: Get release please action + uses: GoogleCloudPlatform/release-please-action@v2 with: token: ${{ secrets.GH_TOKEN }} release-type: node @@ -51,7 +101,12 @@ jobs: # publish only on release publish: name: Publish to Dockerhub - needs: build-test + needs: [ + build, + lint, + e2e-tests, + unit-tests + ] runs-on: ubuntu-latest if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags') steps: @@ -80,7 +135,8 @@ jobs: name: Docs Build Test runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - name: Checkout source + uses: actions/checkout@v2 with: fetch-depth: 1 - name: Set up Python 3.8 @@ -97,7 +153,7 @@ jobs: docker system df docker system prune --all --force --volumes df -h - - name: run docs build + - name: Run docs build run: make docs-build - name: Disk Free After run: | @@ -107,13 +163,11 @@ jobs: # deploy documentation only on release deploy-docs: name: Deploy docs (on release only) - needs: [ - docs-build-test - ] + needs: [docs-build-test] runs-on: ubuntu-latest if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags') steps: - - name: Checkout main + - name: Checkout source uses: actions/checkout@v2 - name: Deploy docs uses: mhausenblas/mkdocs-deploy-gh-pages@1.16