mirror of
https://github.com/cloudflare/wrangler-action.git
synced 2024-11-28 20:54:46 +01:00
edb2a58814
* Removes dependencies such as Docker, decreasing spin-up time * Adds community-requested features, including bulk secrets API utilization from Wrangler * Fixes CI/CD * Adds testing * Improves command implementation * Begins using Node for the Action engine/runner * Openly discusses all changes with the community GitHub Discussions opened and Issues monitored BREAKING CHANGES: * Docker is no longer a dependency * Wrangler v1 is no longer supported Additional related Internal tickets: Major Version Default: https://jira.cfdata.org/browse/DEVX-632 Rewrite Project: DEVX-804,802,800,632
110 lines
3.1 KiB
YAML
110 lines
3.1 KiB
YAML
name: Wrangler Action Self Testing
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
wrangler_action_self_testing:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout Repo
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: "latest"
|
|
cache: "npm"
|
|
|
|
- name: Install Dependencies
|
|
run: npm install
|
|
|
|
- name: Unit Tests
|
|
run: npm run test
|
|
|
|
- name: Check Formatting
|
|
run: npm run check
|
|
|
|
- name: Build Action
|
|
run: npm run build
|
|
|
|
- name: Only build app
|
|
uses: ./
|
|
with:
|
|
workingDirectory: "./test/base"
|
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
command: deploy --dry-run
|
|
|
|
# START Setup and teardown of Worker Environment Tests
|
|
- name: Environment support
|
|
uses: ./
|
|
with:
|
|
workingDirectory: "./test/environment"
|
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
environment: dev
|
|
secrets: |
|
|
SECRET1
|
|
SECRET2
|
|
env:
|
|
SECRET1: ${{ secrets.SECRET1 }}
|
|
SECRET2: ${{ secrets.SECRET2 }}
|
|
|
|
- name: Clean up Deployed Environment Worker
|
|
uses: ./
|
|
with:
|
|
workingDirectory: "./test/base"
|
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
command: delete --name wrangler-action-dev-environment-test --force
|
|
|
|
# END Setup and teardown of Worker Environment Tests
|
|
# START Setup and teardown of Workers w/ Secrets Tests
|
|
- name: Deploy app secrets w/ hardcoded Wrangler v2
|
|
uses: ./
|
|
with:
|
|
wranglerVersion: "2.20.0"
|
|
workingDirectory: "./test/base"
|
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
secrets: |
|
|
SECRET1
|
|
SECRET2
|
|
env:
|
|
SECRET1: ${{ secrets.SECRET1 }}
|
|
SECRET2: ${{ secrets.SECRET2 }}
|
|
|
|
- name: Health Check Deployed Worker
|
|
run: node .github/workflows/workerHealthCheck.cjs
|
|
shell: bash
|
|
|
|
- name: Deploy app secrets w/ default version
|
|
uses: ./
|
|
with:
|
|
workingDirectory: "./test/base"
|
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
secrets: |
|
|
SECRET1
|
|
SECRET2
|
|
env:
|
|
SECRET1: ${{ secrets.SECRET1 }}
|
|
SECRET2: ${{ secrets.SECRET2 }}
|
|
|
|
- name: Health Check Deployed Worker
|
|
run: node .github/workflows/workerHealthCheck.cjs
|
|
shell: bash
|
|
|
|
- name: Clean Up Deployed Workers
|
|
uses: ./
|
|
with:
|
|
workingDirectory: "./test/base"
|
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
command: delete --name wrangler-action-test --force
|
|
# END Setup and teardown of Workers w/ Secrets Tests
|