зеркало из
1
0
Форкнуть 0

ci: change macos-latest to macos-12 to keep supporting node 14 (#828)

This commit is contained in:
Jikun 2024-05-15 14:32:50 +08:00 коммит произвёл GitHub
Родитель 6bfcb69b92
Коммит 0055b77b69
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
3 изменённых файлов: 380 добавлений и 380 удалений

222
.github/workflows/azuresdkdrop.yml поставляемый
Просмотреть файл

@ -1,111 +1,111 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Create release and publish to drop
permissions: write-all
on: workflow_dispatch
jobs:
test:
name: Run tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
node-version: [14.x, 16.x, 18.x]
steps:
- uses: actions/checkout@v2
with:
ref: main
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm test
packageAndRelease:
needs: [ test ]
name: Package / tag / release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: main
- name: Use Node.js 18.x
uses: actions/setup-node@v1
with:
node-version: 18.x
- run: npm ci
- run: npm run build
- run: npm pack
- name: Upload
uses: actions/upload-artifact@v2
with:
name: package
path: "*.tgz"
- name: Get package version
run: echo "NPM_PACKAGE_VERSION=$(jq -r ".version" package.json)" >> $GITHUB_ENV
- name: Get package path
run: echo "NPM_PACKAGE_PATH=$(ls *.tgz)" >> $GITHUB_ENV
- name: Get commit SHA
run: echo "GIT_COMMIT_SHA=$(git rev-parse HEAD)" >> $GITHUB_ENV
- name: Create tag
uses: actions/github-script@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "refs/tags/v${{ env.NPM_PACKAGE_VERSION }}",
sha: "${{ env.GIT_COMMIT_SHA }}"
})
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ env.NPM_PACKAGE_VERSION }}
release_name: v${{ env.NPM_PACKAGE_VERSION }}
draft: true
prerelease: true
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ env.NPM_PACKAGE_PATH }}
asset_name: ${{ env.NPM_PACKAGE_PATH }}
asset_content_type: application/tar+gzip
copy:
name: "Copy to drop"
needs: [ packageAndRelease ]
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: package
- name: Upload to drop
run: |
ls -la
PACKAGE_ID=`echo $(ls *.tgz) | sed -e 's/\.tgz$//'`
echo $PACKAGE_ID
az storage blob upload -n azure-staticwebapps/npm/$PACKAGE_ID/$(ls *.tgz) -c drops -f $(ls *.tgz) --account-name $AZURE_SDK_STORAGE_ACCOUNT_NAME --account-key $AZURE_SDK_DROP_ACCESS_KEY
env:
AZURE_SDK_STORAGE_ACCOUNT_NAME: ${{secrets.AZURE_SDK_STORAGE_ACCOUNT_NAME}}
AZURE_SDK_DROP_ACCESS_KEY: ${{secrets.AZURE_SDK_DROP_ACCESS_KEY}}
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Create release and publish to drop
permissions: write-all
on: workflow_dispatch
jobs:
test:
name: Run tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-12, windows-latest, ubuntu-latest]
node-version: [14.x, 16.x, 18.x]
steps:
- uses: actions/checkout@v2
with:
ref: main
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm test
packageAndRelease:
needs: [ test ]
name: Package / tag / release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: main
- name: Use Node.js 18.x
uses: actions/setup-node@v1
with:
node-version: 18.x
- run: npm ci
- run: npm run build
- run: npm pack
- name: Upload
uses: actions/upload-artifact@v2
with:
name: package
path: "*.tgz"
- name: Get package version
run: echo "NPM_PACKAGE_VERSION=$(jq -r ".version" package.json)" >> $GITHUB_ENV
- name: Get package path
run: echo "NPM_PACKAGE_PATH=$(ls *.tgz)" >> $GITHUB_ENV
- name: Get commit SHA
run: echo "GIT_COMMIT_SHA=$(git rev-parse HEAD)" >> $GITHUB_ENV
- name: Create tag
uses: actions/github-script@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "refs/tags/v${{ env.NPM_PACKAGE_VERSION }}",
sha: "${{ env.GIT_COMMIT_SHA }}"
})
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ env.NPM_PACKAGE_VERSION }}
release_name: v${{ env.NPM_PACKAGE_VERSION }}
draft: true
prerelease: true
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ env.NPM_PACKAGE_PATH }}
asset_name: ${{ env.NPM_PACKAGE_PATH }}
asset_content_type: application/tar+gzip
copy:
name: "Copy to drop"
needs: [ packageAndRelease ]
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: package
- name: Upload to drop
run: |
ls -la
PACKAGE_ID=`echo $(ls *.tgz) | sed -e 's/\.tgz$//'`
echo $PACKAGE_ID
az storage blob upload -n azure-staticwebapps/npm/$PACKAGE_ID/$(ls *.tgz) -c drops -f $(ls *.tgz) --account-name $AZURE_SDK_STORAGE_ACCOUNT_NAME --account-key $AZURE_SDK_DROP_ACCESS_KEY
env:
AZURE_SDK_STORAGE_ACCOUNT_NAME: ${{secrets.AZURE_SDK_STORAGE_ACCOUNT_NAME}}
AZURE_SDK_DROP_ACCESS_KEY: ${{secrets.AZURE_SDK_DROP_ACCESS_KEY}}

468
.github/workflows/ci.yml поставляемый
Просмотреть файл

@ -1,234 +1,234 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: CI
on:
push:
branches: [main, ga]
pull_request:
branches: [main, ga]
jobs:
format:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 18.x
- run: npm ci
- run: npm run format
test-macos:
needs: [format]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest]
node-version: [14.x, 15.x, 16.x, 17.x, 18.x]
name: "test: use node ${{ matrix.node-version }}"
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules-${{ matrix.os }}-${{ matrix.node-version }}
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
- name: "npm test"
run: |
npm ci
npm test
e2e-deploy-macos:
needs: [test-macos]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest]
node-version: [14.x, 15.x, 16.x, 17.x, 18.x]
name: "deploy: use node ${{ matrix.node-version }}"
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules-${{ matrix.os }}-${{ matrix.node-version }}
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
- name: "swa deploy"
run: |
npm ci
npm link
cd cypress/fixtures/
swa deploy app --dry-run --verbose=silly --api-location=./static/api --app-location ./static --deployment-token=00000000000000000000000000000000000000000000000000000000000000000-00000000-0000-0000-0000-00000000000000000000
test-windows:
needs: [format]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest]
node-version: [14.x, 15.x, 16.x, 17.x, 18.x]
name: "test: use node ${{ matrix.node-version }}"
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules-${{ matrix.os }}-${{ matrix.node-version }}
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
- name: "npm test"
run: |
npm ci
npm test -- --maxWorkers=1
e2e-deploy-windows:
needs: [test-windows]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest]
node-version: [14.x, 15.x, 16.x, 17.x, 18.x]
name: "deploy: use node ${{ matrix.node-version }}"
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules-${{ matrix.os }}-${{ matrix.node-version }}
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
- name: "swa deploy"
run: |
npm ci
npm link
cd cypress/fixtures/
swa deploy app --dry-run --verbose=silly --api-location=./static/api --app-location ./static --deployment-token=00000000000000000000000000000000000000000000000000000000000000000-00000000-0000-0000-0000-00000000000000000000
test-linux:
needs: [format]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
node-version: [14.x, 15.x, 16.x, 17.x, 18.x]
name: "test: use node ${{ matrix.node-version }}"
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules-${{ matrix.os }}-${{ matrix.node-version }}
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
- name: "npm test"
run: |
npm ci
npm test
e2e-deploy-linux:
needs: [test-linux]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
node-version: [14.x, 15.x, 16.x, 17.x, 18.x]
name: "deploy: use node ${{ matrix.node-version }}"
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules-${{ matrix.os }}-${{ matrix.node-version }}
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
- name: "swa deploy"
run: |
npm ci
npm link
cd cypress/fixtures/
swa deploy app --dry-run --verbose=silly --api-location=./static/api --app-location ./static --deployment-token=00000000000000000000000000000000000000000000000000000000000000000-00000000-0000-0000-0000-00000000000000000000
package:
needs: [e2e-deploy-macos, e2e-deploy-linux, e2e-deploy-windows]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 18.x
- run: npm ci
- run: npm version prerelease --preid=ci-$GITHUB_RUN_ID --no-git-tag-version
- run: npm pack
- name: Upload
uses: actions/upload-artifact@v2
with:
name: static-web-apps-cli
path: "*.tgz"
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: CI
on:
push:
branches: [main, ga]
pull_request:
branches: [main, ga]
jobs:
format:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 18.x
- run: npm ci
- run: npm run format
test-macos:
needs: [format]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-12]
node-version: [14.x, 15.x, 16.x, 17.x, 18.x]
name: "test: use node ${{ matrix.node-version }}"
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules-${{ matrix.os }}-${{ matrix.node-version }}
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
- name: "npm test"
run: |
npm ci
npm test
e2e-deploy-macos:
needs: [test-macos]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-12]
node-version: [14.x, 15.x, 16.x, 17.x, 18.x]
name: "deploy: use node ${{ matrix.node-version }}"
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules-${{ matrix.os }}-${{ matrix.node-version }}
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
- name: "swa deploy"
run: |
npm ci
npm link
cd cypress/fixtures/
swa deploy app --dry-run --verbose=silly --api-location=./static/api --app-location ./static --deployment-token=00000000000000000000000000000000000000000000000000000000000000000-00000000-0000-0000-0000-00000000000000000000
test-windows:
needs: [format]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest]
node-version: [14.x, 15.x, 16.x, 17.x, 18.x]
name: "test: use node ${{ matrix.node-version }}"
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules-${{ matrix.os }}-${{ matrix.node-version }}
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
- name: "npm test"
run: |
npm ci
npm test -- --maxWorkers=1
e2e-deploy-windows:
needs: [test-windows]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest]
node-version: [14.x, 15.x, 16.x, 17.x, 18.x]
name: "deploy: use node ${{ matrix.node-version }}"
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules-${{ matrix.os }}-${{ matrix.node-version }}
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
- name: "swa deploy"
run: |
npm ci
npm link
cd cypress/fixtures/
swa deploy app --dry-run --verbose=silly --api-location=./static/api --app-location ./static --deployment-token=00000000000000000000000000000000000000000000000000000000000000000-00000000-0000-0000-0000-00000000000000000000
test-linux:
needs: [format]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
node-version: [14.x, 15.x, 16.x, 17.x, 18.x]
name: "test: use node ${{ matrix.node-version }}"
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules-${{ matrix.os }}-${{ matrix.node-version }}
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
- name: "npm test"
run: |
npm ci
npm test
e2e-deploy-linux:
needs: [test-linux]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
node-version: [14.x, 15.x, 16.x, 17.x, 18.x]
name: "deploy: use node ${{ matrix.node-version }}"
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules-${{ matrix.os }}-${{ matrix.node-version }}
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
- name: "swa deploy"
run: |
npm ci
npm link
cd cypress/fixtures/
swa deploy app --dry-run --verbose=silly --api-location=./static/api --app-location ./static --deployment-token=00000000000000000000000000000000000000000000000000000000000000000-00000000-0000-0000-0000-00000000000000000000
package:
needs: [e2e-deploy-macos, e2e-deploy-linux, e2e-deploy-windows]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 18.x
- run: npm ci
- run: npm version prerelease --preid=ci-$GITHUB_RUN_ID --no-git-tag-version
- run: npm pack
- name: Upload
uses: actions/upload-artifact@v2
with:
name: static-web-apps-cli
path: "*.tgz"

70
.github/workflows/e2e.yml поставляемый
Просмотреть файл

@ -1,35 +1,35 @@
name: E2E
on:
push:
branches: [main, ga]
pull_request:
branches: [main, ga]
jobs:
e2e:
runs-on: ${{ matrix.os }}
strategy:
# when one test fails, DO NOT cancel the other
# containers, because this will kill Cypress processes
# https://github.com/cypress-io/github-action/issues/48
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-20.04]
node-version: [14.x, 15.x, 16.x, 17.x]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cypress run
uses: cypress-io/github-action@v2
with:
record: false
video: false
start: npm run e2e:static
wait-on: "http://0.0.0.0:1234, http://localhost:7071"
wait-on-timeout: 120
env:
DEBUG: "cypress:*"
CI: 1
name: E2E
on:
push:
branches: [main, ga]
pull_request:
branches: [main, ga]
jobs:
e2e:
runs-on: ${{ matrix.os }}
strategy:
# when one test fails, DO NOT cancel the other
# containers, because this will kill Cypress processes
# https://github.com/cypress-io/github-action/issues/48
fail-fast: false
matrix:
os: [macos-12, windows-latest, ubuntu-20.04]
node-version: [14.x, 15.x, 16.x, 17.x]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cypress run
uses: cypress-io/github-action@v2
with:
record: false
video: false
start: npm run e2e:static
wait-on: "http://0.0.0.0:1234, http://localhost:7071"
wait-on-timeout: 120
env:
DEBUG: "cypress:*"
CI: 1