3 Star 0 Fork 0

mirrors_NordicSemiconductor/asset-tracker-cloud-app-aws-js

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
test-and-release.yaml 2.79 KB
一键复制 编辑 原始数据 按行查看 历史
name: Test and Release
on: push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AWS_REGION: ${{ secrets.AWS_REGION }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_REGION }}
AWS_ROLE: ${{ secrets.AWS_ROLE }}
WEBAPP_STACK_NAME: ${{ secrets.WEBAPP_STACK_NAME }}
permissions:
id-token: write
contents: write
issues: write
jobs:
test-and-release:
runs-on: ubuntu-22.04
environment: production
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
- uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "npm"
- name: Cache AWS CLI (Linux)
id: cache-aws-cli
uses: actions/cache@v4
with:
path: aws/
key: cache-aws-cli
- name: Install AWS
if: steps.cache-aws-cli.outputs.cache-hit != 'true'
run: |
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip -q awscliv2.zip
sudo ./aws/install --update
- name: configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.AWS_ROLE }}
role-session-name: web-app-ci
aws-region: ${{ env.AWS_REGION }}
- name: Install dependencies
run: npm ci --no-audit
- name: Get web app configuration
run: node .github/workflows/web-app-config.js >> $GITHUB_ENV
- name: Install playwright
run: npx playwright install
- name: Compile TypeScript
run: npx tsc
- name: Check source code with eslint
run: |
npx eslint ./
- name: Check if source code is properly formatted
run: npx prettier -c ./
- name: Run unit tests
run: npm test
- name: Build
env:
PUBLIC_VERSION: ${{ github.sha }}
run: npm run build
- uses: actions/upload-artifact@v4
if: always()
with:
if-no-files-found: error
name: asset-tracker-cloud-app-aws-${{ github.sha }}
path: build
- name: Run end-to-end tests
run: npm run test:e2e
- name: Cleanup test artifacts
if: ${{ failure() }}
run: |
aws iot delete-thing --thing-name `cat test-session/asset.json | jq -r '.thingName'`
aws iot delete-thing --thing-name `cat test-session/asset-no-gnss.json | jq -r '.thingName'`
- name: Cleanup old assets
run: npx tsx e2e-tests/clean-up/cleanOldAssets.ts
- uses: actions/upload-artifact@v4
if: always()
with:
if-no-files-found: error
name: playwright-artifacts-${{ github.sha }}
path: |
server.log
test-session
- name: Semantic release
continue-on-error: true
run: npx semantic-release
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors_NordicSemiconductor/asset-tracker-cloud-app-aws-js.git
git@gitee.com:mirrors_NordicSemiconductor/asset-tracker-cloud-app-aws-js.git
mirrors_NordicSemiconductor
asset-tracker-cloud-app-aws-js
asset-tracker-cloud-app-aws-js
saga

搜索帮助