diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index e2db104..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,36 +0,0 @@ -# This is a basic workflow to help you get started with Actions -#go -name: CI - -# Controls when the workflow will run -on: - # Triggers the workflow on push or pull request events but only for the "main" branch - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains a single job called "build" - build: - # The type of runner that the job will run on - runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 - - # Runs a single command using the runners shell - - name: Run a one-line script - run: echo Hello, world! - - # Runs a set of commands using the runners shell - - name: Run a multi-line script - run: | - echo Add other actions to build, - echo test, and deploy your project. diff --git a/.github/workflows/world.yml b/.github/workflows/world.yml index 8b13789..69108a2 100644 --- a/.github/workflows/world.yml +++ b/.github/workflows/world.yml @@ -1 +1,81 @@ - +name: Java CI +on: push +env: # Set the secret as an input + docker_username: ${{ github.actor }} + docker_password: ${{ secrets.GITHUB_TOKEN }} + GIT_COMMIT: ${{ github.sha }} +jobs: + Clone-down: + name: Clone down repo + runs-on: ubuntu-latest + container: gradle:6-jdk11 + steps: + - uses: actions/checkout@v3 + - name: Upload Repo + uses: actions/upload-artifact@v3 + with: + name: code + path: . + Build: + runs-on: ubuntu-latest + needs: Clone-down + container: gradle:6-jdk11 + steps: + - name: Download code + uses: actions/download-artifact@v3 + with: + name: code + path: . + - name: Build with Gradle + run: chmod +x ci/build-app.sh && ci/build-app.sh + - name: Test with Gradle + run: chmod +x ci/unit-test-app.sh && ci/unit-test-app.sh + - name: Upload Repo + uses: actions/upload-artifact@v3 + with: + name: code + path: . + - name: Upload Jar + uses: actions/upload-artifact@v3 + with: + name: Jar + path: app/build/libs/app-0.1-all.jar + Docker-image: + runs-on: ubuntu-latest + needs: [Build] + permissions: + packages: write + steps: + - name: Download code + uses: actions/download-artifact@v3 + with: + name: code + path: . + - name: build docker + run: chmod +x ci/build-docker.sh && ci/build-docker.sh + - name: push docker + run: chmod +x ci/push-docker.sh && ci/push-docker.sh + #Add job named Component-test + Component-test: + runs-on: ubuntu-latest + needs: Docker-image + steps: + - name: Download code + uses: actions/download-artifact@v3 + with: + name: code + path: . + - name: Execute component test + run: chmod +x ci/component-test.sh && ci/component-test.sh + #Add another job named Performance-test + Performance-test: + runs-on: ubuntu-latest + needs: Docker-image + steps: + - name: Download code + uses: actions/download-artifact@v3 + with: + name: code + path: . + - name: Execute performance test + run: chmod +x ci/performance-test.sh && ci/performance-test.sh