Remove test from old framework and replace with new. Start test. #439
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: 🧪 AB testing | |
| permissions: | |
| contents: read | |
| on: | |
| push: | |
| paths: | |
| - 'ab-testing/**' | |
| - '.github/workflows/ab-testing-ci.yml' | |
| jobs: | |
| config-ci: | |
| runs-on: ubuntu-latest | |
| name: Config CI | |
| defaults: | |
| run: | |
| working-directory: ab-testing/config | |
| env: | |
| FASTLY_AB_TESTING_CONFIG: ${{ secrets.FASTLY_PROD_AB_TESTING_CONFIG }} | |
| FASTLY_API_TOKEN: ${{ secrets.FASTLY_PROD_API_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Node environment | |
| uses: ./.github/actions/setup-node-env | |
| - name: Test | |
| run: pnpm test | |
| - name: Lint | |
| run: pnpm lint | |
| - name: Prettier Check | |
| run: pnpm prettier:check | |
| - name: Typecheck | |
| run: pnpm tsc | |
| - name: Validate | |
| run: pnpm validate | |
| - name: Build | |
| run: pnpm build | |
| - uses: actions/upload-artifact@v5 | |
| with: | |
| name: ab-testing-build | |
| path: ab-testing/config/dist | |
| ui-ci: | |
| name: UI CI | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ab-testing/frontend | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Node environment | |
| uses: ./.github/actions/setup-node-env | |
| - name: Build UI | |
| run: pnpm build | |
| - name: Save build | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: ui-build | |
| path: ab-testing/frontend/output/ab-tests.html | |
| if-no-files-found: error | |
| deploy-lambda-ci: | |
| name: Lambda CI | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ab-testing/deploy-lambda | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Node environment | |
| uses: ./.github/actions/setup-node-env | |
| - name: Build Lambda | |
| run: pnpm build | |
| - name: Zip app artifact | |
| run: | | |
| cd dist | |
| zip -r lambda.zip . | |
| zip -j lambda.zip ../package.json | |
| - name: Save build | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: ab-testing-deploy-lambda-build | |
| path: ab-testing/deploy-lambda/dist/lambda.zip | |
| notification-lambda-ci: | |
| name: Notification Lambda CI | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ab-testing/notification-lambda | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Node environment | |
| uses: ./.github/actions/setup-node-env | |
| - name: Build Lambda | |
| run: pnpm build | |
| - name: Zip app artifact | |
| run: | | |
| cd dist | |
| zip -r lambda.zip . | |
| zip -j lambda.zip ../package.json | |
| - name: Save build | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: ab-testing-notification-lambda-build | |
| path: ab-testing/notification-lambda/dist/lambda.zip | |
| riff-raff: | |
| name: Riff-Raff Artifacts | |
| runs-on: ubuntu-latest | |
| needs: [config-ci, ui-ci, deploy-lambda-ci, notification-lambda-ci] | |
| permissions: | |
| id-token: write | |
| contents: read | |
| pull-requests: write | |
| defaults: | |
| run: | |
| working-directory: ab-testing | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Set up Node | |
| uses: ./.github/actions/setup-node-env | |
| - name: Fetch config build | |
| uses: actions/download-artifact@v6.0.0 | |
| with: | |
| name: ab-testing-build | |
| path: ab-testing/config/dist | |
| - name: Fetch UI build | |
| uses: actions/download-artifact@v6.0.0 | |
| with: | |
| name: ui-build | |
| path: ab-testing/frontend/output/ab-tests.html | |
| - name: Fetch Deploy Lambda build | |
| uses: actions/download-artifact@v6.0.0 | |
| with: | |
| name: ab-testing-deploy-lambda-build | |
| path: ab-testing/deploy-lambda/dist/lambda.zip | |
| - name: Fetch Notification Lambda build | |
| uses: actions/download-artifact@v6.0.0 | |
| with: | |
| name: ab-testing-notification-lambda-build | |
| path: ab-testing/notification-lambda/dist/lambda.zip | |
| - name: CDK Test | |
| run: pnpm --filter @guardian/ab-testing-cdk test | |
| - name: CDK synth | |
| run: pnpm --filter @guardian/ab-testing-cdk synth | |
| - name: Riff-Raff Upload | |
| uses: guardian/actions-riff-raff@v4.1.9 | |
| with: | |
| roleArn: ${{ secrets.GU_RIFF_RAFF_ROLE_ARN }} | |
| githubToken: ${{ secrets.GITHUB_TOKEN }} | |
| projectName: dotcom:ab-testing | |
| configPath: ab-testing/cdk/cdk.out/riff-raff.yaml | |
| contentDirectories: | | |
| ab-testing-config-artifacts: | |
| - ab-testing/config/dist | |
| ab-testing-deployment-lambda: | |
| - ab-testing/deploy-lambda/dist/lambda.zip | |
| ab-testing-notification-lambda: | |
| - ab-testing/notification-lambda/dist/lambda.zip | |
| ab-testing-ui-artifact: | |
| - ab-testing/frontend/output/ab-tests.html | |
| cdk.out: | |
| - ab-testing/cdk/cdk.out |