chore: use newer node & npm versions #213
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
| # yaml-language-server: $schema=https://www.schemastore.org/github-workflow.json | |
| --- | |
| name: Stage | |
| on: | |
| pull_request_target: | |
| types: | |
| - closed | |
| branches: | |
| - main | |
| - 'release/*' | |
| paths: | |
| - "src/**" | |
| - "test/**" | |
| - "package-lock.json" | |
| - "package.json" | |
| - "tsconfig.json" | |
| - ".github/workflows/stage.yml" | |
| - "docker-image/**" | |
| permissions: | |
| contents: write | |
| id-token: write | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| if: github.repository_owner == 'guacsec' && github.event.pull_request.merged == true && !startsWith(github.head_ref, 'release/') | |
| name: Test before staging | |
| steps: | |
| - name: Checkout sources | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install node 20 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Update npm | |
| run: npm install -g [email protected] | |
| - name: Enable Corepack | |
| run: corepack enable | |
| - name: Prepare Yarn | |
| run: corepack prepare [email protected] --activate | |
| - name: Prepare PNPM | |
| run: corepack prepare pnpm@latest --activate | |
| - name: Setup Java 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: 17 | |
| cache: maven | |
| - name: setup go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.20.1' | |
| - name: Setup Gradle | |
| uses: gradle/gradle-build-action@v3 | |
| - name: Setup syft | |
| uses: jaxxstorm/[email protected] | |
| with: | |
| repo: anchore/syft | |
| platform: linux | |
| arch: amd64 | |
| - name: Setup skopeo | |
| run: sudo apt update && sudo apt-get -y install skopeo | |
| - name: Install project modules | |
| run: npm ci | |
| - name: Compile project | |
| run: npm run compile | |
| - name: Check if re-test is needed | |
| id: test-check | |
| uses: zvigrinberg/[email protected] | |
| with: | |
| base-ref: ${{ github.base_ref }} | |
| pr-ref: ${{ github.head_ref }} | |
| file-pattern-regex: "^src/.*|^test/.*" | |
| - name: setup Python | |
| uses: actions/setup-python@v4 | |
| if: steps.test-check.outputs.retest-is-needed == 'true' | |
| with: | |
| python-version: '3.9' | |
| cache: 'pip' | |
| - name: get Python location | |
| id: python-location | |
| run: | | |
| echo "python-bin-location=$(echo $pythonLocation)/bin" >> $GITHUB_OUTPUT | |
| - name: re-test Unit-Tests + Integration Tests | |
| if: steps.test-check.outputs.retest-is-needed == 'true' | |
| env: | |
| TRIGGERING_FILE: ${{ steps.test-check.outputs.triggering-file}} | |
| TRUSTIFY_DA_DEV_MODE: 'true' | |
| DEV_TRUSTIFY_DA_BACKEND_URL: 'https://exhort.stage.devshift.net' | |
| run: | | |
| echo "Re-test was triggered!!, triggering changed file - $TRIGGERING_FILE" | |
| echo "Running Again Unit-tests =>" | |
| npm run test | |
| echo "Running Again Integration tests =>" | |
| npm run integration-tests | |
| publish-prerelease: | |
| needs: test | |
| uses: ./.github/workflows/release.yml | |
| with: | |
| version_type: prerelease |