lecture14_tests.yml (1932B)
1 # This is a basic workflow to help you get started with Actions 2 # You find out more at: https://docs.github.com/en/actions 3 name: Lecture14 Continuous Integration Tests 4 5 # Controls when the workflow will run 6 on: 7 # Triggers the workflow on push or pull request events but only for the master 8 # branch 9 push: 10 branches: 11 - main 12 pull_request: 13 branches: 14 - main 15 16 # Allows you to run this workflow manually from the Actions tab 17 workflow_dispatch: 18 19 # A workflow run is made up of one or more jobs that can run sequentially or in 20 # parallel. For more on jobs: 21 # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobs 22 jobs: 23 # This workflow contains a single job called "install_and_test" 24 install_and_test: 25 26 # The type of runner that the job will run on 27 runs-on: ubuntu-latest 28 29 # Steps represent a sequence of tasks that will be executed as part of the 30 # job. For more on steps: 31 # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idsteps 32 steps: 33 # Check out your repository under $GITHUB_WORKSPACE (job needs access to it) 34 # See: https://github.com/actions/checkout 35 - uses: actions/checkout@v3 36 37 # Enable Python environment in your CI container 38 # See: https://github.com/actions/setup-python 39 - uses: actions/setup-python@v3 40 with: 41 python-version: '3.10' # let's use a recent version 42 43 # Install Python dependencies 44 - name: Install dependencies 45 run: python -m pip install build pytest 46 47 # Build and install our package in the container 48 - name: Build and install the cs107_project in the container (using PEP517/518) 49 run: (python -m build --wheel && python -m pip install dist/*) 50 51 # Run the tests for the installed package 52 - name: Run tests using test harness 53 run: (cd tests && ./run_tests.sh CI)