Add fallback mechanism to validate RPGUNIT version using library text description #199
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build Extension & CLI | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| jobs: | |
| api: | |
| name: Test API | |
| runs-on: ubuntu-latest | |
| environment: COMMON1 | |
| strategy: | |
| matrix: | |
| node-version: [20.x] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Use Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| - name: Install API Dependencies | |
| working-directory: api | |
| run: npm install | |
| - name: Run API Tests With Coverage | |
| working-directory: api | |
| run: npm run coverage | |
| env: | |
| VITE_IBMI_HOST: ${{ secrets.IBMI_HOST }} | |
| VITE_IBMI_USER: ${{ secrets.IBMI_USER }} | |
| VITE_IBMI_PASSWORD: ${{ secrets.IBMI_PASSWORD }} | |
| VITE_IBMI_SSH_PORT: ${{ secrets.IBMI_SSH_PORT }} | |
| - name: Upload Coverage Report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: vscode-ibmi-testing-pr-coverage | |
| path: api/coverage | |
| if-no-files-found: error | |
| extension: | |
| name: Build Extension | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node-version: [20.x] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Use Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Install Dependencies | |
| run: | | |
| npm install | |
| npm install -g vsce | |
| cd cli | |
| npm install | |
| - name: Update Version | |
| run: | | |
| CURRENT_VERSION=$(node -p "require('./package.json').version") | |
| BRANCH="${GITHUB_HEAD_REF:-${GITHUB_REF_NAME}}" | |
| SAFE_BRANCH=$(echo "$BRANCH" | sed 's/[^a-zA-Z0-9]/-/g') | |
| HASH=$(git rev-parse --short HEAD) | |
| NEW_VERSION="${CURRENT_VERSION}-${SAFE_BRANCH}-${HASH}" | |
| npm version "${NEW_VERSION}" --no-git-tag-version | |
| - name: Build Extension | |
| run: | | |
| vsce package | |
| - name: Upload VSIX | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: vscode-ibmi-testing-pr-build | |
| path: ./*.vsix | |
| if-no-files-found: error | |
| cli: | |
| name: Build CLI | |
| runs-on: ubuntu-latest | |
| environment: COMMON1 | |
| strategy: | |
| matrix: | |
| node-version: [20.x] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Use Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Install CLI Dependencies | |
| working-directory: cli | |
| run: | | |
| npm run install:api | |
| npm install | |
| - name: Build CLI | |
| working-directory: cli | |
| run: | | |
| npm run webpack | |
| npm publish --dry-run | |
| - name: Install CLI Tools | |
| run: npm i -g @ibm/ibmi-ci | |
| - name: Build Sample Project | |
| working-directory: examples/ibmi-company_system | |
| run: | | |
| ici \ | |
| --cmd "mkdir -p './builds/itest_${GITHUB_HEAD_REF}'" \ | |
| --rcwd "./builds/itest_${GITHUB_HEAD_REF}" \ | |
| --push "." \ | |
| --ignore --cl "CRTLIB ITESTPR" \ | |
| --ignore --cl "CLRLIB ITESTPR" \ | |
| --cmd "/QOpenSys/pkgs/bin/gmake BIN_LIB=ITESTPR" | |
| env: | |
| IBMI_HOST: ${{ secrets.IBMI_HOST }} | |
| IBMI_USER: ${{ secrets.IBMI_USER }} | |
| IBMI_PASSWORD: ${{ secrets.IBMI_PASSWORD }} | |
| IBMI_SSH_PORT: ${{ secrets.IBMI_SSH_PORT }} | |
| - name: Test CLI | |
| working-directory: cli | |
| run: | | |
| chmod +x ./dist/index.js | |
| ./dist/index.js \ | |
| --ld ../examples/ibmi-company_system \ | |
| --id /home/SANJULA/builds/ibmi-company_system \ | |
| --ll ITESTPR RPGUNIT QDEVTOOLS \ | |
| --cl ITESTPR \ | |
| --cc --sr --tr --to --co | |
| env: | |
| IBMI_HOST: ${{ secrets.IBMI_HOST }} | |
| IBMI_USER: ${{ secrets.IBMI_USER }} | |
| IBMI_PASSWORD: ${{ secrets.IBMI_PASSWORD }} | |
| IBMI_SSH_PORT: ${{ secrets.IBMI_SSH_PORT }} |