mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-19 10:17:23 -05:00
* Apply prettier to css, js, html, md, ts, and yml As a followup I will add prettier to the .pre-commit config. This patch is 100% generated by prettier. I used a forked version of prettier that understands the py-script tag. See https://github.com/hoodmane/pyscript-prettier-precommit for more info. * Apply old pre-commit * Revert some problems * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Revert some changes * More changes * Fix pre-commit * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
108 lines
3.1 KiB
YAML
108 lines
3.1 KiB
YAML
name: '[CI] Build Unstable'
|
|
|
|
on:
|
|
push: # Only run on merges into main that modify files under pyscriptjs/ and examples/
|
|
branches:
|
|
- main
|
|
paths:
|
|
- pyscriptjs/**
|
|
- examples/**
|
|
- .github/workflows/build-latest.yml # Test that workflow works when changed
|
|
|
|
pull_request: # Run on any PR that modifies files under pyscriptjs/ and examples/
|
|
branches:
|
|
- main
|
|
paths:
|
|
- pyscriptjs/**
|
|
- examples/**
|
|
- .github/workflows/build-unstable.yml # Test that workflow works when changed
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
BuildAndTest:
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: pyscriptjs
|
|
env:
|
|
MINICONDA_PYTHON_VERSION: py38
|
|
MINICONDA_VERSION: 4.11.0
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Install node
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 18.x
|
|
|
|
- name: Cache node modules
|
|
uses: actions/cache@v3
|
|
env:
|
|
cache-name: cache-node-modules
|
|
with:
|
|
# npm cache files are stored in `~/.npm` on Linux/macOS
|
|
path: ~/.npm
|
|
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-build-${{ env.cache-name }}-
|
|
${{ runner.os }}-build-
|
|
${{ runner.os }}-
|
|
|
|
- name: setup Miniconda
|
|
uses: conda-incubator/setup-miniconda@v2
|
|
|
|
- name: Setup Environment
|
|
run: make setup
|
|
|
|
- name: Build
|
|
run: make build
|
|
|
|
- name: TypeScript Tests
|
|
run: make test-ts
|
|
|
|
- name: Python Tests
|
|
run: make test-py
|
|
|
|
- name: Integration Tests
|
|
run: make test-integration-parallel
|
|
|
|
- uses: actions/upload-artifact@v3
|
|
with:
|
|
name: pyscript
|
|
path: |
|
|
pyscriptjs/build/
|
|
if-no-files-found: error
|
|
retention-days: 7
|
|
|
|
- uses: actions/upload-artifact@v3
|
|
if: success() || failure()
|
|
with:
|
|
name: test_results
|
|
path: pyscriptjs/test_results
|
|
if-no-files-found: error
|
|
|
|
Deploy:
|
|
runs-on: ubuntu-latest
|
|
needs: BuildAndTest
|
|
if: github.ref == 'refs/heads/main' # Only deploy on merge into main
|
|
permissions:
|
|
contents: read
|
|
id-token: write
|
|
|
|
steps:
|
|
- uses: actions/download-artifact@v3
|
|
with:
|
|
name: pyscript
|
|
path: ./build/
|
|
|
|
# Deploy to S3
|
|
- name: Configure AWS credentials
|
|
uses: aws-actions/configure-aws-credentials@v1.6.1
|
|
with:
|
|
aws-region: ${{ secrets.AWS_REGION }}
|
|
role-to-assume: ${{ secrets.AWS_OIDC_RUNNER_ROLE }}
|
|
|
|
- name: Sync to S3
|
|
run: aws s3 sync --quiet ./build/ s3://pyscript.net/unstable/
|