Skip to content

Release Wave Nightly #2059

Release Wave Nightly

Release Wave Nightly #2059

name: Release Wave Nightly
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *" # Schedule at midnight.
env:
TAG: "nightly"
# Cancel a currently running workflow.
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
# TODO: Use composite action to make the configuration more DRY.
jobs:
check-last-commit:
name: Check Last Commit
runs-on: ubuntu-20.04
outputs:
yesterday-commit-count: ${{ steps.get-new-commits.outputs.YESTERDAY_COMMIT_COUNT }}
nightly-dev-version: ${{ steps.get-dev-version.outputs.NIGHTLY_DEV_VERSION }}
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.GIT_TOKEN }}
- id: get-new-commits
run: echo "YESTERDAY_COMMIT_COUNT=$(git log --oneline --since '24 hours ago' | wc -l)" >> $GITHUB_OUTPUT
- id: get-dev-version
run: echo "NIGHTLY_DEV_VERSION=$(awk -F"'" '/__version__/ {split($2,a,"."); a[2]++; print a[1] "." a[2] ".0.dev0"}' py/h2o_wave/h2o_wave/version.py)" >> $GITHUB_OUTPUT
test-linux:
name: Test Linux
needs: check-last-commit
if: needs.check-last-commit.outputs.yesterday-commit-count > 0
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
py: ["3.8", "3.9", "3.10", "3.11"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.GIT_TOKEN }}
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.py }}
- uses: actions/setup-go@v4
with:
go-version: "1.22"
- uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
- name: Setup
run: |
make setup-ui build-ui
make setup-py-tests
make setup-vsc
make setup-e2e
make build-server
env:
NODE_OPTIONS: "--max-old-space-size=8192"
- name: Test
run: |
make test-e2e-ci
make test-py-ci
make test-vsc-ci
test-win:
name: Test Windows
needs: check-last-commit
if: needs.check-last-commit.outputs.yesterday-commit-count > 0
strategy:
matrix:
py: ["3.8", "3.9", "3.10", "3.11"]
runs-on: windows-2022
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.GIT_TOKEN }}
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.py }}
- uses: actions/setup-go@v4
with:
go-version: "1.22"
- uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
- name: Setup
run: .\setup.ps1
shell: pwsh
env:
NODE_OPTIONS: "--max-old-space-size=8192"
- name: Test
run: .\test.ps1
shell: pwsh
test-macos:
name: Test MacOS
needs: check-last-commit
if: needs.check-last-commit.outputs.yesterday-commit-count > 0
strategy:
matrix:
py: ["3.8", "3.9", "3.10", "3.11"]
runs-on: macos-12
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.GIT_TOKEN }}
- name: Install docker
run: |
brew install qemu
brew install docker
colima start
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.py }}
- uses: actions/setup-go@v4
with:
go-version: "1.22"
- uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
- name: Setup
run: |
make setup-ui build-ui
make setup-py-tests
make setup-vsc
make setup-e2e
make build-server
env:
NODE_OPTIONS: "--max-old-space-size=8192"
- name: Test
run: |
make test-e2e-macos-ci
make test-py-ci
make test-vsc-ci
env:
KC_SLEEP: 45
release:
needs: [test-linux, test-win, check-last-commit]
name: Release Wave Nightly
runs-on: ubuntu-20.04
steps:
- name: Set ENV vars
run: |
echo "VERSION=${{ needs.check-last-commit.outputs.nightly-dev-version }}" >> $GITHUB_ENV
- uses: actions/checkout@v2
with:
token: ${{ secrets.GIT_TOKEN }}
- uses: actions/setup-go@v4
with:
go-version: "1.22"
- uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
- name: Setup
run: make setup
- uses: r-lib/actions/setup-r@v2
- uses: r-lib/actions/setup-r-dependencies@v2
with:
working-directory: ./r
# These unit tests are not OS-dependent, so no need to run them in the dedicated Test jobs.
- name: Unit test
run: |
make test-ui-ci
make test-intellij-ci
- name: Build Release
run: make release-nightly
env:
NODE_OPTIONS: "--max-old-space-size=8192"
- name: Update tag
run: git tag -f ${{ env.TAG }} && git push -f --tags
- uses: actions/github-script@v5
with:
github-token: ${{ secrets.GIT_TOKEN }}
script: |
const tag = "${{ env.TAG }}";
const { data: releases } = await github.rest.repos.listReleases({
owner: context.repo.owner,
repo: context.repo.repo
});
const release = releases.find(r => r.tag_name === tag);
if (release) {
await github.rest.repos.deleteRelease({
owner: context.repo.owner,
repo: context.repo.repo,
release_id: release.id
});
console.log(`Deleted release ${tag}`);
} else {
console.log(`Release ${tag} not found`);
}
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
build/wave-${{ env.VERSION }}-darwin-amd64.tar.gz
build/wave-${{ env.VERSION }}-darwin-arm64.tar.gz
build/wave-${{ env.VERSION }}-linux-amd64.tar.gz
build/wave-${{ env.VERSION }}-windows-amd64.tar.gz
py/h2o_wave/dist/h2o_wave-${{ env.VERSION }}-py3-none-macosx_10_9_x86_64.whl
py/h2o_wave/dist/h2o_wave-${{ env.VERSION }}-py3-none-macosx_11_0_arm64.whl
py/h2o_wave/dist/h2o_wave-${{ env.VERSION }}-py3-none-macosx_12_0_arm64.whl
py/h2o_wave/dist/h2o_wave-${{ env.VERSION }}-py3-none-manylinux1_x86_64.whl
py/h2o_wave/dist/h2o_wave-${{ env.VERSION }}-py3-none-win_amd64.whl
py/h2o_wave/dist/h2o_wave-${{ env.VERSION }}-py3-none-any.whl
r/build/h2owave_nightly_R.tar.gz
tag_name: ${{ env.TAG }}
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}