Skip to content

Commit

Permalink
meh
Browse files Browse the repository at this point in the history
  • Loading branch information
feisuzhu committed Aug 30, 2022
1 parent f8671f0 commit 5f1e5d6
Showing 1 changed file with 5 additions and 115 deletions.
120 changes: 5 additions & 115 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,127 +17,17 @@ env:
TI_TEST_OFFLINE_CACHE: ${{ github.event.schedule == '0 18 * * *' && '1' || '' }}

jobs:
show_environ:
name: Show Environment Variables
# Disable this workflow on forks
if: github.repository_owner == 'taichi-dev'
runs-on: [self-hosted, Linux]
steps:
- name: Environment Variables
run: env
- name: Github Object
run: |
cat <<'EOF'
${{ toJson(github) }}
EOF
check_files:
name: Check files
# Disable this workflow on forks
if: github.repository_owner == 'taichi-dev'
outputs:
run_job: ${{ steps.check_files.outputs.run_job }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 2

- name: check modified files
id: check_files
run: |
echo "Concurrency group: ${{ github.event.number || github.run_id }}"
echo "=============== list modified files ==============="
git diff --name-only @^
chore_files=( LICENSE CONTRIBUTING.md README.md netlify.toml )
chore_dirs=( docs )
run_job=false
for file in $(git diff --name-only @^); do
is_chore=false
for chore_file in ${chore_files[*]}; do
[[ ${file} == ${chore_file} ]] && is_chore=true && break
done
for chore_dir in ${chore_dirs[*]}; do
[[ ${file} == ${chore_dir}/* ]] && is_chore=true && break
done
if ! ${is_chore}; then
run_job=true
break
fi
done
if ${run_job}; then
echo "::set-output name=run_job::true"
else
echo "::set-output name=run_job::false"
fi
build_and_test_cpu_windows:
name: Build and Test Windows (CPU)
needs: check_files
strategy:
matrix:
include:
- os: windows-2019
llvmVer : '15'
- os: windows-2019
llvmVer : '10'
name: Meh
timeout-minutes: ${{ github.event.schedule != '0 18 * * *' && 90 || 180 }}
runs-on: windows-2019
permissions:
packages: read
contents: read
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'

- name: Get Build Cache
uses: actions/cache@v3
if: needs.check_files.outputs.run_job == 'true'
with:
path: ${{ env.LocalAppData }}/build-cache
key: ccache-win64-cpu-${{ github.sha }}
restore-keys: |
build-cache-win64-cpu-
- name: Get Docker Images
shell: pwsh
if: needs.check_files.outputs.run_job == 'true'
run: |
. .github/workflows/common-utils.ps1
echo ${{ secrets.GITHUB_TOKEN }} | Invoke docker login ghcr.io -u ${{ github.actor }} --password-stdin
Invoke docker pull ghcr.io/taichi-dev/taichidev-cpu-windows:v0.0.1
# TODO: split build and test
- name: Build and Test
shell: pwsh
if: needs.check_files.outputs.run_job == 'true'
run: |
. .github/workflows/common-utils.ps1
PrepareBuildCache
docker create --name taichi_build_test \
-e TI_LITE_TEST \
-e TI_TEST_OFFLINE_CACHE \
ghcr.io/taichi-dev/taichidev-cpu-windows:v0.0.1 \
C:/taichi/.github/workflows/scripts/win_build_test_cpu.ps1 -llvmVer ${{ matrix.llvmVer }}
tar -cf - ../${{ github.event.repository.name }} --mode u=+rwx,g=+rwx,o=+rwx | docker cp - taichi_build_test:C:/
docker start -a taichi_build_test
rm -rf ccache_cache
docker cp taichi_build_test:C:/taichi/ccache_cache ccache_cache
# - name: Save wheel if test failed
# if: failure() && steps.build_and_test.conclusion == 'failure'
# uses: actions/upload-artifact@v3
# with:
# name: broken-wheel
# path: dist/*
# retention-days: 7

run: >-
docker run -i
mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019
powershell -Command 'gci env:*'

0 comments on commit 5f1e5d6

Please sign in to comment.