chore(deps): update redhat-actions/buildah-build action to v3 #397
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 | |
| on: | |
| pull_request: | |
| merge_group: | |
| push: | |
| branches: | |
| - develop | |
| tags: | |
| - '*' | |
| jobs: | |
| Build: | |
| name: 'Build and Test on Node ${{ matrix.node_version }} and ${{ matrix.os }}' | |
| runs-on: '${{ matrix.os }}' | |
| strategy: | |
| matrix: | |
| node_version: | |
| - 22 | |
| - 24 | |
| os: | |
| - ubuntu-latest | |
| - macOS-latest | |
| - windows-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: 'Use Node.js ${{ matrix.node_version }}' | |
| uses: actions/setup-node@v7 | |
| with: | |
| node-version: '${{ matrix.node_version }}' | |
| - name: npm build and test | |
| run: | | |
| npm ci | |
| npm run build | |
| npm test | |
| end2end: | |
| name: 'End2End on k6 ${{ matrix.k6_version }}' | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| k6_version: | |
| - '0.54.0' | |
| - '1.0.0' | |
| - '1.5.0' | |
| - '1.7.1' | |
| # renovate: datasource=github-releases depName=grafana/k6 | |
| - '2.0.0' | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Build k6s image for k6 ${{ matrix.k6_version }} | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: . | |
| push: false | |
| load: true | |
| tags: cloudtooling/k6s:e2e-${{ matrix.k6_version }} | |
| build-args: | | |
| K6_VERSION=${{ matrix.k6_version }} | |
| - name: Create Docker network | |
| run: docker network create e2e-net | |
| - name: Start Keycloak | |
| run: | | |
| docker run -d \ | |
| --name keycloak \ | |
| --network e2e-net \ | |
| -p 8080:8080 \ | |
| -e KEYCLOAK_ADMIN=admin \ | |
| -e KEYCLOAK_ADMIN_PASSWORD=admin \ | |
| quay.io/keycloak/keycloak:26.6 \ | |
| start-dev | |
| - name: Generate RSA key pair and certificate | |
| run: | | |
| openssl req -x509 -newkey rsa:2048 \ | |
| -keyout tests/e2e/private_key.pem \ | |
| -out tests/e2e/cert.pem \ | |
| -days 1 -nodes \ | |
| -subj "/CN=k6s-test-client" | |
| chmod 644 tests/e2e/private_key.pem tests/e2e/cert.pem | |
| - name: Configure Keycloak realm and client | |
| env: | |
| KC_URL: http://localhost:8080 | |
| KC_REALM: e2e | |
| CLIENT_ID: k6s-test-client | |
| CERT_PATH: tests/e2e/cert.pem | |
| run: bash tests/e2e/setup-keycloak.sh | |
| - name: Run k6 e2e test | |
| run: | | |
| docker run --rm \ | |
| --network e2e-net \ | |
| -v "${{ github.workspace }}/tests/e2e:/home/k6/tests" \ | |
| -e KC_URL=http://keycloak:8080 \ | |
| -e KC_REALM=e2e \ | |
| -e CLIENT_ID=k6s-test-client \ | |
| cloudtooling/k6s:e2e-${{ matrix.k6_version }} \ | |
| run /home/k6/tests/k6-test.js | |
| - name: Cleanup | |
| if: always() | |
| run: | | |
| docker stop keycloak 2>/dev/null || true | |
| docker rm keycloak 2>/dev/null || true | |
| docker network rm e2e-net 2>/dev/null || true | |
| Container: | |
| name: Build Container Image | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Write version vars | |
| id: version-vars | |
| run: | | |
| BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` | |
| BRANCH=${GITHUB_REF_NAME#v} | |
| APP_VERSION=$(jq -r ".version" package.json) | |
| echo Version: $APP_VERSION | |
| echo "VERSION=$APP_VERSION" >> $GITHUB_ENV | |
| echo "APP_VERSION=$APP_VERSION" >> $GITHUB_ENV | |
| echo "BUILD_DATE=$BUILD_DATE" >> $GITHUB_ENV | |
| - name: Build Container Image | |
| id: build-image | |
| uses: docker/build-push-action@v7 | |
| with: | |
| push: false | |
| tags: | | |
| cloudtooling/k6s:next | |
| cloudtooling/k6s:${{github.run_id }} | |
| cloudtooling/k6s:${{env.APP_VERSION}}_rc | |
| build-args: | | |
| BUILD_DATE=${{env.BUILD_DATE}} | |
| APP_VERSION=${{env.APP_VERSION}} | |
| - name: Log in to GitHub container registry | |
| uses: docker/login-action@v4 | |
| with: | |
| username: ${{ vars.DOCKER_HUB_USER}} | |
| password: ${{ secrets.DOCKER_HUB_TOKEN }} | |
| if: github.ref == 'refs/heads/develop' | |
| - name: Deploy Container Image | |
| id: push-to-dockerhub-release | |
| run: | | |
| docker push cloudtooling/k6s:next | |
| docker push cloudtooling/k6s:${{env.APP_VERSION}}_rc | |
| if: github.ref == 'refs/heads/develop' | |
| Build-results: | |
| name: Build results | |
| if: ${{ always() }} | |
| runs-on: ubuntu-latest | |
| needs: | |
| - Build | |
| - end2end | |
| - Container | |
| steps: | |
| - run: exit 1 | |
| # see https://stackoverflow.com/a/67532120/4907315 | |
| if: >- | |
| ${{ | |
| contains(needs.*.result, 'failure') | |
| || contains(needs.*.result, 'cancelled') | |
| || contains(needs.*.result, 'skipped') | |
| }} |