Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,21 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
lfs: true

- name: Install Git LFS
run: |
sudo apt-get update
sudo apt-get install git-lfs
git lfs install

# GIT CONFIGURATION
- name: Configure Git user
run: |
git config --global user.email "you@example.com"
git config --global user.name "Your Name"

- name: Use Node.js 14
uses: actions/setup-node@v4.0.2
with:
Expand All @@ -15,6 +30,25 @@ jobs:
- name: Code Linting
run: npm run lint
- run: npm run build --if-present

- name: Check existence of cx-linux binary
run: |
if [ ! -f "src/main/wrapper/resources/cx-linux" ]; then
echo "cx-linux binary does not exist"; exit 1;
fi

- name: Check existence of cx.exe binary
run: |
if [ ! -f "src/main/wrapper/resources/cx.exe" ]; then
echo "cx.exe binary does not exist"; exit 1;
fi

- name: Check existence of cx-mac binary
run: |
if [ ! -f "src/main/wrapper/resources/cx-mac" ]; then
echo "cx-mac binary does not exist"; exit 1;
fi

- name: Run tests
env:
CX_CLIENT_ID: ${{ secrets.CX_CLIENT_ID}}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: true # Ensure LFS files are checked out

# GIT CONFIGURATION
- run: |
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/update-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,50 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
lfs: true

- name: Install Git LFS
run: |
sudo apt-get update
sudo apt-get install git-lfs
git lfs install

- name: Configure Git user
run: |
git config --global user.name github-actions
git config --global user.email github-actions@github.com

- name: Get Latest Checkmarx API version
id: checkmarx-ast-cli
run: |
echo ::set-output name=release_tag::$(curl -sL https://api.github.com/repos/Checkmarx/ast-cli/releases/latest | jq -r ".tag_name")
echo ::set-output name=current_tag::$(<checkmarx-ast-cli.version)

- name: Update Checkmarx cli version
if: steps.checkmarx-ast-cli.outputs.current_tag != steps.checkmarx-ast-cli.outputs.release_tag
env:
RELEASE_TAG: ${{ steps.checkmarx-ast-cli.outputs.release_tag }}
run: |
# Update current release
echo ${{ steps.checkmarx-ast-cli.outputs.release_tag }} > checkmarx-ast-cli.version

- name: Track large files with Git LFS
run: |
git lfs track "src/main/wrapper/resources/cx-linux"
git lfs track "src/main/wrapper/resources/cx.exe"
git lfs track "src/main/wrapper/resources/cx-mac"
git add .gitattributes
git add src/main/wrapper/resources/cx-linux src/main/wrapper/resources/cx.exe src/main/wrapper/resources/cx-mac
git commit -m "Track Checkmarx CLI binaries with Git LFS"

- name: Download latest cli and update branch
if: steps.checkmarx-ast-cli.outputs.current_tag != steps.checkmarx-ast-cli.outputs.release_tag
run: |
# Update binaries
chmod +x ./.github/scripts/update_cli.sh
./.github/scripts/update_cli.sh ${{ steps.checkmarx-ast-cli.outputs.release_tag }}

- name: Create Pull Request
if: steps.checkmarx-ast-cli.outputs.current_tag != steps.checkmarx-ast-cli.outputs.release_tag
uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c #v6
Expand Down