Standardize API key secret name to QAMAX_API_KEY #6
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: Test Action | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build | |
| run: npm run build | |
| - name: Check dist is up to date | |
| run: | | |
| # Only check the main index.js file, ignore source maps (they contain local paths) | |
| if [ "$(git diff --ignore-space-at-eol dist/index.js | wc -l)" -gt "0" ]; then | |
| echo "dist/index.js is out of date. Run 'npm run build' and commit the changes." | |
| git diff dist/index.js | head -50 | |
| exit 1 | |
| fi | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Lint | |
| run: npm run lint | |
| # Integration test with real API (only on main branch with secrets) | |
| integration: | |
| if: github.ref == 'refs/heads/main' && github.repository == 'Quality-Max/qualitymax-github-action' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Check if secrets are available | |
| id: check-secrets | |
| run: | | |
| if [ -n "${{ secrets.QAMAX_API_KEY }}" ] && [ -n "${{ secrets.QUALITYMAX_TEST_PROJECT_ID }}" ]; then | |
| echo "available=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "available=false" >> $GITHUB_OUTPUT | |
| echo "Skipping integration test - secrets not configured" | |
| fi | |
| - name: Test Action | |
| if: steps.check-secrets.outputs.available == 'true' | |
| uses: ./ | |
| with: | |
| api-key: ${{ secrets.QAMAX_API_KEY }} | |
| project-id: ${{ secrets.QUALITYMAX_TEST_PROJECT_ID }} | |
| test-suite: 'smoke' | |
| timeout-minutes: '10' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |