2022-06-08 21:15:58 +00:00
|
|
|
name: Webassembly
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ master ]
|
|
|
|
pull_request:
|
|
|
|
branches: [ master ]
|
|
|
|
schedule:
|
|
|
|
- cron: '10 12 * * 0'
|
|
|
|
|
2022-10-13 23:30:13 +00:00
|
|
|
concurrency:
|
2022-06-25 11:25:13 +00:00
|
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2022-07-01 23:27:24 +00:00
|
|
|
env:
|
|
|
|
AWS_ACCESS_KEY_ID: ${{secrets.S3_ACCESS_KEY}}
|
|
|
|
AWS_SECRET_ACCESS_KEY: ${{secrets.S3_SECRET_KEY}}
|
|
|
|
AWS_DEFAULT_REGION: us-west-2
|
|
|
|
|
2022-06-08 21:15:58 +00:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: ${{ matrix.type }}-build
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-06-15 22:59:05 +00:00
|
|
|
type: [client, client-debug]
|
2022-06-08 21:15:58 +00:00
|
|
|
fail-fast: false
|
|
|
|
steps:
|
2022-10-13 23:30:13 +00:00
|
|
|
- uses: actions/checkout@v3
|
2022-06-08 21:15:58 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 2
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
sudo apt-get -qq update
|
|
|
|
sudo apt-get install -y p7zip-full zip
|
|
|
|
|
|
|
|
- name: Cache dependencies
|
2022-10-13 23:30:13 +00:00
|
|
|
uses: actions/cache@v3
|
2022-06-08 21:15:58 +00:00
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
3rdParty/buildCache
|
|
|
|
!3rdParty/buildCache/wasm/vcpkgcache/
|
|
|
|
key: wasm-${{ matrix.type }}-${{ hashFiles('wasm/*.sh') }}
|
|
|
|
restore-keys: wasm-${{ matrix.type }}-
|
|
|
|
|
|
|
|
- name: Check if build is running from origin repo
|
|
|
|
if: ${{ success() && env.AWS_ACCESS_KEY_ID != 0 && env.AWS_SECRET_ACCESS_KEY != 0 }}
|
|
|
|
run: |
|
|
|
|
echo "VCPKG_BINARY_SOURCES=clear;x-aws,s3://vcpkg.cache.boinc/,readwrite" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- name: Check if build is running from fork
|
|
|
|
if: ${{ success() && (env.AWS_ACCESS_KEY_ID == 0 || env.AWS_SECRET_ACCESS_KEY == 0) }}
|
|
|
|
run: |
|
|
|
|
echo "VCPKG_BINARY_SOURCES=clear;x-aws-config,no-sign-request;x-aws,s3://vcpkg.cache.boinc/,read" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- name: Automake
|
|
|
|
if: success()
|
|
|
|
run: ./_autosetup
|
|
|
|
|
|
|
|
- name: Configure client as webassembly
|
|
|
|
if: success() && matrix.type == 'client'
|
|
|
|
run: wasm/ci_configure_client.sh
|
|
|
|
|
2022-06-15 22:59:05 +00:00
|
|
|
- name: Configure client as webassembly
|
|
|
|
if: success() && matrix.type == 'client-debug'
|
|
|
|
run: wasm/ci_configure_client.sh debug
|
|
|
|
|
2022-06-08 21:15:58 +00:00
|
|
|
- name: Make
|
|
|
|
if: success()
|
|
|
|
run: wasm/ci_make.sh
|
|
|
|
|
|
|
|
- name: Prepare logs on failure
|
|
|
|
if: ${{ failure() }}
|
2022-07-12 02:32:57 +00:00
|
|
|
run: python ./deploy/prepare_deployment.py logs
|
2022-10-13 23:30:13 +00:00
|
|
|
|
2022-06-08 21:15:58 +00:00
|
|
|
- name: Upload logs on failure
|
|
|
|
if: ${{ failure() }}
|
2022-10-13 23:30:13 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
2022-06-08 21:15:58 +00:00
|
|
|
with:
|
|
|
|
name: wasm_logs_${{ matrix.type }}_${{ github.event.pull_request.head.sha }}
|
|
|
|
path: deploy/logs.7z
|
|
|
|
|
|
|
|
- name: Prepare artifacts for deploy
|
2022-10-13 23:30:13 +00:00
|
|
|
if: success() && ! contains(matrix.type, 'libs') && ! contains(matrix.type, 'debug')
|
2022-06-08 21:15:58 +00:00
|
|
|
env:
|
|
|
|
PULL_REQUEST: ${{ github.event.number }}
|
|
|
|
PULL_REQUEST_SHA: ${{ github.event.pull_request.head.sha }}
|
|
|
|
run: python ./deploy/prepare_deployment.py wasm_${{ matrix.type }}
|
|
|
|
|
2022-06-15 22:59:05 +00:00
|
|
|
- name: Prepare artifacts for debug deploy
|
|
|
|
if: success() && matrix.type == 'client-debug'
|
|
|
|
env:
|
|
|
|
PULL_REQUEST: ${{ github.event.number }}
|
|
|
|
PULL_REQUEST_SHA: ${{ github.event.pull_request.head.sha }}
|
2022-06-25 14:51:16 +00:00
|
|
|
run: python ./deploy/prepare_deployment.py wasm_${{ matrix.type }}
|
2022-06-15 22:59:05 +00:00
|
|
|
|
2022-06-08 21:15:58 +00:00
|
|
|
- name: Upload artifacts
|
2022-10-13 23:30:13 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
2022-06-08 21:15:58 +00:00
|
|
|
if: ${{ ! contains(matrix.type, 'libs') }}
|
|
|
|
with:
|
|
|
|
name: wasm_${{ matrix.type }}_${{ github.event.pull_request.head.sha }}
|
|
|
|
path: deploy/wasm_${{ matrix.type }}.7z
|
|
|
|
|