From 644d68873a83e6e74b32efef76ea01b29a5d8b53 Mon Sep 17 00:00:00 2001 From: Jiasheng Zhang Date: Fri, 6 Aug 2021 16:52:35 +0800 Subject: [PATCH] test windows schedule --- .github/workflows/release.yml | 56 +++++++++++++++++++++-------------- .github/workflows/time.yml | 16 ++++++---- 2 files changed, 44 insertions(+), 28 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a35c179ad..56ef26f63 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,6 +3,8 @@ on: release: # https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#release types: [published] + schedule: + - cron: "*/10 * * * *" jobs: build_and_test_mac: @@ -13,15 +15,15 @@ jobs: - os: macos-latest python: 3.6 with_cc: OFF - - os: macos-latest - python: 3.7 - with_cc: OFF - - os: macos-latest - python: 3.8 - with_cc: OFF - - os: macos-latest - python: 3.9 - with_cc: OFF + #- os: macos-latest + # python: 3.7 + # with_cc: OFF + #- os: macos-latest + # python: 3.8 + # with_cc: OFF + #- os: macos-latest + # python: 3.9 + # with_cc: OFF runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 @@ -58,10 +60,15 @@ jobs: - name: Upload PyPI env: # https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets#using-encrypted-secrets-in-a-workflow - PYPI_PWD: "sjaaeriguhbnaeikd" + PROD_PWD: "PROD" + NIGHT_PWD: "NIGHTLY" run: | cd python - python build.py upload + [ -z "${{ github.event.action }}" ] && export PYPI_PWD="$NIGHT_PWD" + [ -z "${{ github.event.action }}" ] && python build.py upload --testpypi --project_name taichi_nightly + [ -z "${{ github.event.action }}" ] || export PYPI_PWD="$PROD_PWD" + [ -z "${{ github.event.action }}" ] || python build.py upload + echo $PYPI_PWD build_and_test_windows: name: Build and Test (windows only) @@ -71,15 +78,15 @@ jobs: - os: windows-latest python: 3.6 with_cc: OFF - - os: windows-latest - python: 3.7 - with_cc: OFF - - os: windows-latest - python: 3.8 - with_cc: OFF - - os: windows-latest - python: 3.9 - with_cc: OFF + #- os: windows-latest + # python: 3.7 + # with_cc: OFF + #- os: windows-latest + # python: 3.8 + # with_cc: OFF + #- os: windows-latest + # python: 3.9 + # with_cc: OFF runs-on: ${{ matrix.os }} steps: - name: Install 7Zip PowerShell @@ -129,7 +136,12 @@ jobs: shell: powershell env: # https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets#using-encrypted-secrets-in-a-workflow - PYPI_PWD: "asdfasdjggaelkri" + PROD_PWD: "PROD" + NIGHT_PWD: "NIGHTLY" run: | cd python - python build.py upload + if ([string]::IsNullOrEmpty("${{ github.event.action }}")) {$env:PYPI_PWD = "$env:NIGHT_PWD"} + if ([string]::IsNullOrEmpty("${{ github.event.action }}")) {python build.py upload --testpypi --project_name taichi_nightly} + if ( -not [string]::IsNullOrEmpty("${{ github.event.action }}")) {$env:PYPI_PWD = "$env:PROD_PWD"} + if ( -not [string]::IsNullOrEmpty("${{ github.event.action }}")) {python build.py upload} + echo "$env:PYPI_PWD" diff --git a/.github/workflows/time.yml b/.github/workflows/time.yml index db93afc25..192d72e33 100644 --- a/.github/workflows/time.yml +++ b/.github/workflows/time.yml @@ -8,15 +8,19 @@ on: jobs: test_schedule: name: schedule test - runs-on: macos-latest + runs-on: windows-latest steps: - name: test + shell: powershell + env: + PROD_PWD: "PROD" + NIGHT_PWD: "NIGHTLY" run: | echo "${{ github.event.action }}" echo "Triggered every 5 minites!" - [ -z "${{ github.event.action }}" ] && export RELEASE="perform nightly release" - [ -z "${{ github.event.action }}" ] && ls - [ -z "${{ github.event.action }}" ] || export RELEASE="perform production release" - [ -z "${{ github.event.action }}" ] || pwd - echo $RELEASE + if ([string]::IsNullOrEmpty("${{ github.event.action }}")) {$env:RELEASE = "$env:NIGHT_PWD"} + if ([string]::IsNullOrEmpty("${{ github.event.action }}")) {echo "running nightly"} + if ( -not [string]::IsNullOrEmpty("${{ github.event.action }}")) {$env:RELEASE = "$env:PROD_PWD"} + if ( -not [string]::IsNullOrEmpty("${{ github.event.action }}")) {echo "running production"} + echo "$env:RELEASE"