diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..bf51445f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,46 @@ +name: AST Eclipse Plugin + +on: [pull_request] + +jobs: + integration-tests: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + + - name: Cache local Maven repository + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + + - name: Run tests with Maven + env: + CX_CLIENT_ID: ${{ secrets.CLIENT_ID}} + CX_CLIENT_SECRET: ${{ secrets.CLIENT_SECRET}} + CX_BASE_URI: ${{ secrets.BASE_URI }} + CX_TENANT: ${{ secrets.TENANT }} + run: mvn clean install + cx-scan: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Checkmarx AST CLI Action + uses: checkmarxDev/ast-github-action@master + with: + project_name: ast-eclipse-plugin + branch: master + base_uri: ${{ secrets.BASE_URI }} + cx_tenant: ${{ secrets.TENANT }} + cx_client_id: ${{ secrets.CLIENT_ID }} + cx_client_secret: ${{ secrets.CLIENT_SECRET }} + additional_params: --tags galactica-team \ No newline at end of file diff --git a/.github/workflows/manual-tag.yml b/.github/workflows/manual-tag.yml new file mode 100644 index 00000000..4cca27b3 --- /dev/null +++ b/.github/workflows/manual-tag.yml @@ -0,0 +1,27 @@ +name: Manual Tag Creation + +on: + workflow_dispatch: + inputs: + tag: + description: 'Next release tag' + required: true + +jobs: + tag-creation: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + - name: Tag + run: | + echo ${{ github.event.inputs.tag }} + echo "NEXT_VERSION=${{ github.event.inputs.tag }}" >> $GITHUB_ENV + - name: Create tag + uses: actions-ecosystem/action-push-tag@v1 + env: + GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + with: + tag: ${{ env.NEXT_VERSION }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..7426ae54 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,37 @@ +name: Release Creation + +on: + push: + tags: + - "*" + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + + - name: Set env + run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + + - name: Cache local Maven repository + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + + - name: Update the POM version. + run: mvn -B versions:set -DnewVersion='${{ env.RELEASE_VERSION }}' --file pom.xml -DskipTests + + - name: Create release + run: mvn clean install + + - name: Release + uses: softprops/action-gh-release@v1 + with: + files: ./com.checkmarx.eclipse.site/target/com.checkmarx.eclipse.site-*.zip diff --git a/.gitignore b/.gitignore index b83d2226..0f630157 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /target/ +/bin/