|
| 1 | +# -------------------------------------------- |
| 2 | +# This is a basic workflow to help you get started with Actions |
| 3 | +# -------------------------------------------- |
| 4 | +name: Build |
| 5 | + |
| 6 | +on: |
| 7 | + # -------------------------------------------- |
| 8 | + # Controls when the automatic build job will be run. |
| 9 | + # By default uses the default branch. Runs at 03:00 UTC. |
| 10 | + # -------------------------------------------- |
| 11 | + schedule: |
| 12 | + - cron: '17 4 * * *' |
| 13 | + |
| 14 | + # -------------------------------------------- |
| 15 | + # Run this workflow every time a new commit pushed to the repository |
| 16 | + # -------------------------------------------- |
| 17 | + push: |
| 18 | + |
| 19 | + # -------------------------------------------- |
| 20 | + # Run this workflow every time a pull request is created or commited to it |
| 21 | + # -------------------------------------------- |
| 22 | + pull_request: |
| 23 | + branches: |
| 24 | + - '**' |
| 25 | + |
| 26 | +env: |
| 27 | + # ------------------------------------------------------------- |
| 28 | + # Setting up locale to have correct keyboard mapping for swtbot |
| 29 | + # ------------------------------------------------------------- |
| 30 | + LANG: "en_US.UTF-8" |
| 31 | +# -------------------------------------------- |
| 32 | +# Defines the list of jobs |
| 33 | +# -------------------------------------------- |
| 34 | +jobs: |
| 35 | + # -------------------------------------------- |
| 36 | + # Verify Job |
| 37 | + #--------------------------------------------- |
| 38 | + verify: |
| 39 | + name: Verify |
| 40 | + runs-on: ubuntu-18.04 |
| 41 | + |
| 42 | + steps: |
| 43 | + # -------------------------------------------- |
| 44 | + # Checks out a copy of the repository |
| 45 | + # -------------------------------------------- |
| 46 | + - name: Setup - Checkout code |
| 47 | + uses: actions/checkout@v2 |
| 48 | + |
| 49 | + # -------------------------------------------- |
| 50 | + # Run a quick sanity check if all commits are |
| 51 | + # handed in by known users |
| 52 | + #--------------------------------------------- |
| 53 | + - name: Verify - Authors Sanity Check |
| 54 | + uses: virtualsatellite/ci-actions/ci-verify-authors-action@v2 |
| 55 | + |
| 56 | + # ----------------------------------------------------- |
| 57 | + # Build, Assemble and Deploy Job |
| 58 | + # ----------------------------------------------------- |
| 59 | + deploy: |
| 60 | + name: Build, Assemble and Deploy |
| 61 | + runs-on: ubuntu-18.04 |
| 62 | + needs: [verify] |
| 63 | + |
| 64 | + steps: |
| 65 | + # -------------------------------------------- |
| 66 | + # Checks out a copy of your repository |
| 67 | + # -------------------------------------------- |
| 68 | + - name: Setup - Checkout code |
| 69 | + uses: actions/checkout@v2 |
| 70 | + |
| 71 | + # -------------------------------------------- |
| 72 | + # Setup caching for m2 repository |
| 73 | + # -------------------------------------------- |
| 74 | + - name: Setup - Cache local m2 repository |
| 75 | + uses: actions/cache@v2 |
| 76 | + with: |
| 77 | + path: ~/.m2/repository/ |
| 78 | + key: ${{ runner.os }}-local-m2-deploy-${{ hashFiles('**/pom.xml') }} |
| 79 | + restore-keys: | |
| 80 | + ${{ runner.os }}-local-m2-deploy- |
| 81 | + ${{ runner.os }}-local-m2- |
| 82 | + |
| 83 | + - name: Setup - Clean local m2 repository |
| 84 | + run: rm -rf ~/.m2/repository/de/dlr/sc/virsat |
| 85 | + |
| 86 | + # -------------------------------------------- |
| 87 | + # Setup caching for p2 repository |
| 88 | + # -------------------------------------------- |
| 89 | + - name: Setup - Cache local p2 repository |
| 90 | + uses: actions/cache@v2 |
| 91 | + with: |
| 92 | + path: ./p2Repo |
| 93 | + key: ${{ runner.os }}-local-p2-deploy-${{ hashFiles('**/pom.xml') }} |
| 94 | + restore-keys: | |
| 95 | + ${{ runner.os }}-local-p2-deploy- |
| 96 | + ${{ runner.os }}-local-p2- |
| 97 | + |
| 98 | + # -------------------------------------------- |
| 99 | + # Perform various setup operations |
| 100 | + # -------------------------------------------- |
| 101 | + - name: Setup - Prepare OS |
| 102 | + uses: virtualsatellite/ci-actions/ci-setup-action@v2 |
| 103 | + |
| 104 | + # -------------------------------------------- |
| 105 | + # Development and Feature branches |
| 106 | + # -------------------------------------------- |
| 107 | + - name: Build - Build and Deploy Decision |
| 108 | + id: build_decision |
| 109 | + uses: virtualsatellite/ci-actions/ci-build-decision-action@v2 |
| 110 | + |
| 111 | + # -------------------------------------------- |
| 112 | + # Prepare p2 Repos |
| 113 | + # -------------------------------------------- |
| 114 | + - name: Build - Prepare p2 repo |
| 115 | + run: mvn install -P prepare-m2e-repo -B -V |
| 116 | + |
| 117 | + # -------------------------------------------- |
| 118 | + # Development and Feature branches |
| 119 | + # -------------------------------------------- |
| 120 | + - name: Build - Assemble |
| 121 | + uses: virtualsatellite/ci-actions/ci-maven-simple-build-action@v2 |
| 122 | + with: |
| 123 | + build_job: assemble |
| 124 | + build_profile: ${{ steps.build_decision.outputs.build_type }} |
| 125 | + |
| 126 | + # --------------------------------------------- |
| 127 | + # Deploying to github releases |
| 128 | + # -------------------------------------------- |
| 129 | + - name: Build - Deploy GH |
| 130 | + uses: virtualsatellite/ci-actions/ci-deploy-gh-product-action@v2 |
| 131 | + with: |
| 132 | + build_profile: ${{ steps.build_decision.outputs.build_type }} |
| 133 | + gh_token: ${{ secrets.GITHUB_TOKEN }} |
| 134 | + if: ${{ steps.build_decision.outputs.deploy_type == 'deploy' }} |
0 commit comments