Skip to content

Commit

Permalink
Update GitHub actions (#2078)
Browse files Browse the repository at this point in the history
* Add mypy check in pre-commit

* Add mypy check in pre-commit

* bug fix

* CI fix

* add python version matrix for checking types in CI

* update github actions

* revert some accidental changes

* revert some accidental changes

* revert some accidental changes

* revert some accidental changes

---------

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
  • Loading branch information
3 people authored Mar 20, 2024
1 parent 42d41a0 commit 4af0440
Show file tree
Hide file tree
Showing 11 changed files with 57 additions and 60 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ jobs:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install packages and dependencies
Expand Down
32 changes: 16 additions & 16 deletions .github/workflows/contrib-openai.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ jobs:
steps:
# checkout to pr branch
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install packages and dependencies
Expand Down Expand Up @@ -70,11 +70,11 @@ jobs:
steps:
# checkout to pr branch
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install packages and dependencies
Expand Down Expand Up @@ -111,11 +111,11 @@ jobs:
steps:
# checkout to pr branch
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install packages and dependencies
Expand Down Expand Up @@ -152,11 +152,11 @@ jobs:
steps:
# checkout to pr branch
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install packages and dependencies
Expand Down Expand Up @@ -190,11 +190,11 @@ jobs:
steps:
# checkout to pr branch
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install packages and dependencies
Expand Down Expand Up @@ -231,11 +231,11 @@ jobs:
steps:
# checkout to pr branch
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install packages and dependencies
Expand Down Expand Up @@ -270,11 +270,11 @@ jobs:
steps:
# checkout to pr branch
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install packages and dependencies
Expand Down Expand Up @@ -309,11 +309,11 @@ jobs:
steps:
# checkout to pr branch
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install packages and dependencies
Expand Down
28 changes: 14 additions & 14 deletions .github/workflows/contrib-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ jobs:
os: [ubuntu-latest, macos-latest, windows-2019]
python-version: ["3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install packages and dependencies for all tests
Expand Down Expand Up @@ -78,9 +78,9 @@ jobs:
os: [ubuntu-latest, macos-latest, windows-2019]
python-version: ["3.8"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install packages and dependencies for all tests
Expand Down Expand Up @@ -115,9 +115,9 @@ jobs:
os: [ubuntu-latest, macos-latest, windows-2019]
python-version: ["3.10"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install packages and dependencies for all tests
Expand Down Expand Up @@ -152,9 +152,9 @@ jobs:
os: [ubuntu-latest, macos-latest, windows-2019]
python-version: ["3.11"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install packages and dependencies for all tests
Expand Down Expand Up @@ -189,9 +189,9 @@ jobs:
os: [ubuntu-latest, macos-latest, windows-2019]
python-version: ["3.12"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install packages and dependencies for all tests
Expand Down Expand Up @@ -226,9 +226,9 @@ jobs:
os: [ubuntu-latest, macos-latest, windows-2019]
python-version: ["3.12"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install packages and dependencies for all tests
Expand Down Expand Up @@ -263,9 +263,9 @@ jobs:
os: [ubuntu-latest, macos-latest, windows-2019]
python-version: ["3.11"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install packages and dependencies for all tests
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/deploy-website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ jobs:
run:
working-directory: website
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
lfs: true
- uses: actions/setup-node@v4
with:
node-version: 18.x
- name: setup python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.8"
- name: pydoc-markdown install
Expand Down Expand Up @@ -73,14 +73,14 @@ jobs:
run:
working-directory: website
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
lfs: true
- uses: actions/setup-node@v4
with:
node-version: 18.x
- name: setup python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.8"
- name: pydoc-markdown install
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/dotnet-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ jobs:
run:
working-directory: dotnet
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
global-json-file: dotnet/global.json
- name: Restore dependencies
Expand All @@ -53,9 +53,9 @@ jobs:
if: success() && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dotnet')
needs: build
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
global-json-file: dotnet/global.json
- name: Restore dependencies
Expand Down Expand Up @@ -83,12 +83,12 @@ jobs:
echo "ls output directory"
ls -R ./output
- name: Upload package
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: nightly
path: ./dotnet/output/nightly
- name: Upload package
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: release
path: ./dotnet/output/release
Expand All @@ -102,17 +102,17 @@ jobs:
needs: openai-test
steps:
- name: Setup .NET
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: '6.0.x'
source-url: https://devdiv.pkgs.visualstudio.com/DevDiv/_packaging/AutoGen/nuget/v3/index.json
env:
NUGET_AUTH_TOKEN: ${{ secrets.AZURE_DEVOPS_TOKEN }}
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
name: nightly
path: ./dotnet/output/nightly
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
name: release
path: ./dotnet/output/release
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dotnet-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ jobs:
run:
working-directory: dotnet
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
global-json-file: dotnet/global.json
- name: Restore dependencies
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/openai.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ jobs:
steps:
# checkout to pr branch
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install packages and dependencies
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ jobs:
env:
SKIP: "mypy"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Set $PY environment variable
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
- uses: pre-commit/action@v3.0.0
- uses: pre-commit/action@v3.0.1
4 changes: 2 additions & 2 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ jobs:
environment: package
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
# - name: Cache conda
# uses: actions/cache@v3
# uses: actions/cache@v4
# with:
# path: ~/conda_pkgs_dir
# key: conda-${{ matrix.os }}-python-${{ matrix.python-version }}-${{ hashFiles('environment.yml') }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/samples-tools-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ jobs:
os: [ubuntu-latest, macos-latest]
python-version: ["3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install packages and dependencies for all tests
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/type-check.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
name: Type check

# see: https://help.github.com/en/actions/reference/events-that-trigger-workflows
on: # Trigger the workflow on pull request or merge
pull_request:
merge_group:
types: [checks_requested]

defaults:
run:
shell: bash
permissions: {}

jobs:
type-check:
strategy:
Expand Down

0 comments on commit 4af0440

Please sign in to comment.