Skip to content

Commit

Permalink
Merge branch 'master' into addcase
Browse files Browse the repository at this point in the history
  • Loading branch information
sansen0796 committed Oct 1, 2023
2 parents d0e56e3 + 2c8c31d commit 1f55ed3
Show file tree
Hide file tree
Showing 14 changed files with 219 additions and 184 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/all-generate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: All generate test

on:
schedule:
- cron: "0 0 * * *"

jobs:
deploy:
uses: ./.github/workflows/generate.yml
with:
force-generate: true
13 changes: 13 additions & 0 deletions .github/workflows/diff-generate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Diff only generate test

on:
push:
branches:
- master
pull_request:

jobs:
generate:
uses: ./.github/workflows/generate.yml
with:
force-generate: false
143 changes: 143 additions & 0 deletions .github/workflows/generate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
name: Generate test

on:
workflow_dispatch:
inputs:
force-generate:
description: Ignore cache and force generate
default: false
type: boolean
enable-gcc-ubuntu-generate:
description: Enable gcc-ubuntu-generate
default: true
type: boolean
enable-clang-mac-generate:
description: Enable clang-mac-generate
default: true
type: boolean
enable-mingw-windows-generate:
description: Enable mingw-windows-generate
default: true
type: boolean
workflow_call:
inputs:
force-generate:
default: false
type: boolean
enable-gcc-ubuntu-generate:
default: true
type: boolean
enable-clang-mac-generate:
default: true
type: boolean
enable-mingw-windows-generate:
default: true
type: boolean

jobs:
gcc-ubuntu-generate:
if: ${{ inputs.enable-gcc-ubuntu-generate }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Python 3.x
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --user -r requirements.txt
- name: Restore versions.json
uses: actions/cache/restore@v3
if: ${{ !inputs.force-generate }}
with:
path: versions.json
key: ${{ runner.os }}-versions-cache-

- name: Run generate.py
run: |
ulimit -s unlimited
./generate_test.py TestGenerateAll
env:
ENABLE_GENERATE_TEST: 1
VERSIONS_CACHE_PATH: versions.json

- name: Save versions.json
uses: actions/cache/save@v3
with:
path: versions.json
key: ${{ runner.os }}-versions-cache-${{ hashFiles('versions.json') }}

clang-mac-generate:
if: ${{ inputs.enable-clang-mac-generate }}
runs-on: macos-latest
steps:
- uses: actions/checkout@v3

- name: Set up Python 3.x
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --user -r requirements.txt
- name: Restore versions.json
uses: actions/cache/restore@v3
if: ${{ !inputs.force-generate }}
with:
path: versions.json
key: ${{ runner.os }}-versions-cache-

- name: Run generate.py
run: |
./generate_test.py TestGenerateAll
env:
CXX: clang++
ENABLE_GENERATE_TEST: 1
VERSIONS_CACHE_PATH: versions.json

- name: Save versions.json
uses: actions/cache/save@v3
with:
path: versions.json
key: ${{ runner.os }}-versions-cache-${{ hashFiles('versions.json') }}

mingw-windows-generate:
if: ${{ inputs.enable-mingw-windows-generate }}
runs-on: windows-latest
steps:
- uses: actions/checkout@v3

- name: Set up Python 3.x
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --user -r requirements.txt
- name: Restore versions.json
uses: actions/cache/restore@v3
if: ${{ !inputs.force-generate }}
with:
path: versions.json
key: ${{ runner.os }}-versions-cache-

- name: Run generate.py
run: |
python generate_test.py TestGenerateAll
env:
ENABLE_GENERATE_TEST: 1
VERSIONS_CACHE_PATH: versions.json

- name: Save versions.json
uses: actions/cache/save@v3
with:
path: versions.json
key: ${{ runner.os }}-versions-cache-${{ hashFiles('versions.json') }}
117 changes: 0 additions & 117 deletions .github/workflows/main.yml

This file was deleted.

66 changes: 0 additions & 66 deletions ci_generate.py

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <cstdio>
#include <vector>
#include <tuple>
#include <algorithm>

using namespace std;
Expand Down
Loading

0 comments on commit 1f55ed3

Please sign in to comment.