Add no-name micro:bit connection #847
Workflow file for this run
This file contains 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
# This workflow uses actions that are not certified by GitHub. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
# GitHub recommends pinning actions to a commit SHA. | |
# To get a newer version, you will need to update the SHA. | |
# You can also reference a tag or branch, but the action may change without warning. | |
name: Testing deployment | |
env: | |
APP_LOCATION: "/" # location of your client code | |
APP_ARTIFACT_LOCATION: "/dist" # location of client code build output | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: [opened, synchronize, reopened, closed] | |
branches: | |
- main | |
permissions: | |
issues: write | |
contents: read | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Run Tests | |
run: | | |
npm install | |
npm test | |
formatting_and_linting: | |
name: Prettier / svelte Check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Run prettier | |
shell: bash | |
run: | | |
npm install | |
npm run prettier | |
# if we find the string modified after running git status, it indicates that prettier has changed files! | |
if git status | grep -c "modified" -eq 0; then | |
exit 1 | |
else | |
exit 0 | |
fi | |
- name: Missing format report | |
shell: bash | |
if: ${{ failure() }} | |
run: | | |
echo "Missing prettier formatting. Please format files using 'npm run prettier' and resubmit!" | |
exit 1 | |
- name: Svelte check | |
shell: bash | |
run: npm run check | |
- name: Svelte check report | |
shell: bash | |
if: ${{ failure() }} | |
run: | | |
echo "Running npm run check found warnings, please resolve them before merging!" | |
exit 1 | |
build_and_deploy: | |
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') | |
runs-on: ubuntu-latest | |
name: Build and Deploy | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Build And Deploy | |
uses: Azure/static-web-apps-deploy@1a947af9992250f3bc2e68ad0754c0b0c11566c9 | |
with: | |
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }} | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
action: "upload" | |
app_location: ${{ env.APP_LOCATION }} | |
app_artifact_location: ${{ env.APP_ARTIFACT_LOCATION }} | |
close: | |
if: github.event_name == 'pull_request' && github.event.action == 'closed' | |
runs-on: ubuntu-latest | |
name: Close | |
steps: | |
- name: Close | |
uses: Azure/static-web-apps-deploy@1a947af9992250f3bc2e68ad0754c0b0c11566c9 | |
with: | |
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }} | |
action: "close" |