| # Licensed to the Apache Software Foundation (ASF) under one or more |
| # contributor license agreements. See the NOTICE file distributed with |
| # this work for additional information regarding copyright ownership. |
| # The ASF licenses this file to You under the Apache License, Version 2.0 |
| # (the "License"); you may not use this file except in compliance with |
| # the License. You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| name: build-branch |
| on: |
| pull_request: |
| push: |
| schedule: |
| - cron: 30 0,12 * * * |
| jobs: |
| build: |
| name: compile |
| runs-on: ubuntu-18.04 |
| steps: |
| - uses: actions/checkout@master |
| - uses: actions/cache@v2 |
| with: |
| path: | |
| ~/.pnpm-store |
| **/node_modules |
| key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} |
| restore-keys: | |
| ${{ runner.os }}-pnpm- |
| - uses: ./.github/buildenv |
| with: |
| args: ./hadoop-ozone/dev-support/checks/build.sh |
| rat: |
| name: rat |
| runs-on: ubuntu-18.04 |
| steps: |
| - uses: actions/checkout@master |
| - uses: ./.github/buildenv |
| with: |
| args: ./hadoop-ozone/dev-support/checks/rat.sh |
| - name: Summary of failures |
| run: cat target/${{ github.job }}/summary.txt |
| if: always() |
| - uses: actions/upload-artifact@master |
| if: always() |
| with: |
| name: rat |
| path: target/rat |
| author: |
| name: author |
| runs-on: ubuntu-18.04 |
| steps: |
| - uses: actions/checkout@master |
| - uses: ./.github/buildenv |
| with: |
| args: ./hadoop-ozone/dev-support/checks/author.sh |
| - name: Summary of failures |
| run: cat target/${{ github.job }}/summary.txt |
| if: always() |
| - uses: actions/upload-artifact@master |
| if: always() |
| with: |
| name: author |
| path: target/author |
| unit: |
| name: unit |
| runs-on: ubuntu-18.04 |
| steps: |
| - uses: actions/checkout@master |
| - uses: ./.github/buildenv |
| with: |
| args: ./hadoop-ozone/dev-support/checks/unit.sh |
| - name: Summary of failures |
| run: cat target/${{ github.job }}/summary.txt |
| if: always() |
| - uses: actions/upload-artifact@master |
| if: always() |
| with: |
| name: unit |
| path: target/unit |
| checkstyle: |
| name: checkstyle |
| runs-on: ubuntu-18.04 |
| steps: |
| - uses: actions/checkout@master |
| - uses: ./.github/buildenv |
| with: |
| args: ./hadoop-ozone/dev-support/checks/checkstyle.sh |
| - name: Summary of failures |
| run: cat target/${{ github.job }}/summary.txt |
| if: always() |
| - uses: actions/upload-artifact@master |
| if: always() |
| with: |
| name: checkstyle |
| path: target/checkstyle |
| findbugs: |
| name: findbugs |
| runs-on: ubuntu-18.04 |
| steps: |
| - uses: actions/checkout@master |
| - uses: ./.github/buildenv |
| with: |
| args: ./hadoop-ozone/dev-support/checks/findbugs.sh |
| - name: Summary of failures |
| run: cat target/${{ github.job }}/summary.txt |
| if: always() |
| - uses: actions/upload-artifact@master |
| if: always() |
| with: |
| name: findbugs |
| path: target/findbugs |
| acceptance: |
| name: acceptance |
| runs-on: ubuntu-18.04 |
| steps: |
| - uses: actions/cache@v2 |
| with: |
| path: ~/.m2/repository |
| key: maven-repo-${{ hashFiles('**/pom.xml') }} |
| - uses: actions/cache@v2 |
| with: |
| path: | |
| ~/.pnpm-store |
| **/node_modules |
| key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} |
| restore-keys: | |
| ${{ runner.os }}-pnpm- |
| - name: checkout to /mnt/ozone |
| run: | |
| sudo chmod 777 /mnt |
| git clone https://github.com/${GITHUB_REPOSITORY}.git /mnt/ozone |
| cd /mnt/ozone |
| git fetch origin "${GITHUB_REF}" |
| git checkout FETCH_HEAD |
| git reset --hard |
| - name: run a full build |
| run: | |
| cd /mnt/ozone |
| hadoop-ozone/dev-support/checks/build.sh -Pcoverage |
| - run: sudo pip install robotframework |
| - run: | |
| cd /mnt/ozone/hadoop-ozone/dist/target/ozone-* && sudo mkdir .aws && sudo chmod 777 .aws && sudo chown 1000 .aws |
| cd /mnt/ozone && hadoop-ozone/dev-support/checks/acceptance.sh |
| env: |
| KEEP_IMAGE: false |
| OZONE_WITH_COVERAGE: true |
| OZONE_VOLUME_OWNER: 1000 |
| - uses: actions/upload-artifact@master |
| if: always() |
| with: |
| name: acceptance |
| path: /mnt/ozone/target/acceptance |
| - run: | |
| #Never cache local artifacts |
| rm -rf ~/.m2/repository/org/apache/hadoop/hdds |
| rm -rf ~/.m2/repository/org/apache/hadoop/ozone |
| if: always() |
| integration: |
| name: integration |
| runs-on: ubuntu-18.04 |
| needs: |
| - build |
| strategy: |
| matrix: |
| profile: |
| - client |
| - filesystem |
| - filesystem-contract |
| - freon |
| - hdds-om |
| - ozone |
| fail-fast: false |
| steps: |
| - run: sudo mkdir mnt && sudo mount --bind /mnt `pwd`/mnt && sudo chmod 777 mnt |
| - uses: actions/checkout@master |
| with: |
| path: mnt/ozone |
| - uses: ./mnt/ozone/.github/buildenv |
| with: |
| args: ./mnt/ozone/hadoop-ozone/dev-support/checks/integration.sh -P${{ matrix.profile }} |
| - name: Summary of failures |
| run: cat mnt/ozone/target/${{ github.job }}/summary.txt |
| if: always() |
| - uses: actions/upload-artifact@master |
| if: always() |
| with: |
| name: it-${{ matrix.profile }} |
| path: mnt/ozone/target/integration |
| coverage: |
| name: coverage |
| runs-on: ubuntu-18.04 |
| needs: |
| - acceptance |
| - integration |
| - unit |
| steps: |
| - uses: actions/checkout@v2 |
| - uses: ./.github/buildenv |
| with: |
| args: ./hadoop-ozone/dev-support/checks/build.sh |
| - uses: actions/download-artifact@v2 |
| with: |
| path: target/artifacts |
| - run: ./hadoop-ozone/dev-support/checks/coverage.sh |
| - uses: ./.github/buildenv |
| if: github.repository == 'apache/hadoop-ozone' && github.event_name != 'pull_request' |
| with: |
| args: ./hadoop-ozone/dev-support/checks/sonar.sh |
| env: |
| SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }} |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| - name: Upload coverage to Codecov |
| uses: codecov/codecov-action@v1 |
| with: |
| file: ./target/coverage/all.xml |
| name: codecov-umbrella |
| fail_ci_if_error: true |
| - uses: actions/upload-artifact@master |
| with: |
| name: coverage |
| path: target/coverage |