8000 Split build jobs, add S3 push by pww217 · Pull Request #307 · pyscript/pyscript · GitHub
[go: up one dir, main page]

Skip to content

Split build jobs, add S3 push #307

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
May 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 18 additions & 10 deletions .github/workflows/build.yml → .github/workflows/build-alpha.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
name: Build
name: '[CI] Build Alpha'

on:
push: # Only run on merges into master that modify files under pyscriptjs/
branches: main
push:
tags:
- '**' # Currently any tag, need to slim down
paths:
- pyscriptjs/**
- .github/workflows/** # Test that workflows work when changed

pull_request: # Run on any PR that modifies files in pyscriptjs/
paths:
- pyscriptjs/**
- .github/workflows/**
- .github/workflows/build-alpha.yml # Test that workflow works when changed

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
defaults:
run:
working-directory: ./pyscriptjs

steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -30,7 +30,7 @@ jobs:
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
# 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: |
Expand All @@ -43,3 +43,11 @@ jobs:
- name: Build pyscript
run: |
npm run 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 . s3://pyscript-static/alpha/ # What artifacts exactly need to be copied?
28 changes: 23 additions & 5 deletions .github/workflows/lint.yml → .github/workflows/build-latest.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
name: Lint
name: '[CI] Build Latest'

on:
push: # Only run on merges into master that modify files under pyscriptjs/
push: # Only run on merges into main that modify files under pyscriptjs/
branches:
- main
paths:
- pyscriptjs/**
- .github/workflows/build-latest.yml # Test that workflow works when changed

pull_request: # Run on any PR that modifies files in pyscriptjs/
paths:
- pyscriptjs/**
- .github/workflows/**

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
defaults:
run:
working-directory: ./pyscriptjs

steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -25,7 +35,7 @@ jobs:
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
# 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: |
Expand All @@ -35,6 +45,14 @@ jobs:
- name: Install dependencies
run: |
npm install
- name: Run linter
- name: Build pyscript
run: |
npm run lint
npm run 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 . s3://pyscript-static/unstable/ # What artifacts exactly need to be copied?
29 changes: 29 additions & 0 deletions .github/workflows/sync-examples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: '[CI] Sync Examples'

on:
push: # Only run on merges into main that modify files under pyscriptjs/examples/
branches:
- main
paths:
- pyscriptjs/examples/**
- .github/workflows/sync-examples.yml # Test that workflow works when changed

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
defaults:
run:
working-directory: ./pyscriptjs/examples

steps:
# 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 . s3://pyscript-static/examples/
0