File size: 1,860 Bytes
d90b3a8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Pull Request

#on: [pull_request, workflow_dispatch]
on: workflow_dispatch

jobs:
  pre-commit:
    runs-on: ubuntu-22.04
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-python@v4
        with:
          python-version: "3.10.14"
          cache: "pip"
          cache-dependency-path: "**/requirements*.txt"
      # Need the right version of clang-format
      - run: pip install -r requirements/requirements-dev.txt
      - uses: pre-commit/[email protected]
      -
        name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v1
      -
        name: Docker build
        id: docker_build
        uses: docker/build-push-action@v2

  update-documentation:
    runs-on: ubuntu-22.04
    steps:
      - uses: actions/checkout@v3
        with:
          ref: ${{ github.event.pull_request.head.ref}}
      - run: |
          rm megatron/__init__.py
          pip install shortuuid
          rm megatron/neox_arguments/__init__.py
          python configs/gen_docs.py
          git config user.name github-actions
          git config user.email [email protected]
          git add configs/neox_arguments.md
          git commit -m "Update NeoXArgs docs automatically"
          git push
  run-tests:
    runs-on: ubuntu-22.04
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-python@v4
        with:
          python-version: "3.10.13"
          cache-dependency-path: "**/requirements*.txt"
      - name: prepare data
        run: python3 prepare_data.py
      - name: install pytest
        run: python3 -m pip install pytest pytest-forked pyyaml requests wandb
      - name: install torch
        run: python3 -m pip install torch
      - name: install requirements
        run: pip install -r requirements/requirements.txt
      - name: Run Tests
        run: pytest --forked tests