Skip to content

Add counterfactual exps #1134

Add counterfactual exps

Add counterfactual exps #1134

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: main workflow
# Controls when the action will run.
on:
# Triggers the workflow on push events but only for the main branch
push:
branches: [ main ]
pull_request:
branches:
- '**'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "test"
test:
# The type of runner that the job will run on
strategy:
matrix:
python-versions: ["3.11"]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
# use cached lfs to save on github bandwidth
# see https://github.com/actions/checkout/issues/165#issuecomment-1639209867
- name: Checkout
uses: actions/checkout@v3
- name: Create LFS file list
run: git lfs ls-files --long | cut -d ' ' -f1 | sort > .lfs-assets-id
- name: LFS Cache
uses: actions/cache@v3
with:
path: .git/lfs/objects
key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}
restore-keys: |
${{ runner.os }}-lfs-
- name: Git LFS Pull
run: git lfs pull
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-versions }}
# pyright needs node
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Cache Python dependencies
uses: actions/cache@v3
id: cache-env
with:
# cache location for venv and nltk
path: |
~/nltk_data
./venv
key: ${{ runner.os }}-cache-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/Makefile') }}
- name: Install dependencies
if: steps.cache-env.outputs.cache-hit != 'true'
run: |
python -m venv venv
source ./venv/bin/activate
make env
echo PATH=$PATH >> $GITHUB_ENV
echo "./venv/bin" >> $GITHUB_PATH
- name: Restore venv
if: steps.cache-env.outputs.cache-hit == 'true'
run: |
source ./venv/bin/activate
echo PATH=$PATH >> $GITHUB_ENV
echo "./venv/bin" >> $GITHUB_PATH
# James gave up on fixing pre commit issues, so we just run black and ruff manually
# Run all the pre-commit hooks on all files
# Skip pyright because we already ran it
# https://github.com/raybears/cot-transparency/actions/runs/6377663506/job/17306743190
# - name: Run pre-commit hooks
# run: |
# make hooks
# SKIP=no-commit-to-branch pre-commit run --all-files
- name: Run ruff
run: |
ruff --fix .
- name: Run black
run: |
black .
- name: Run pyright
run: |
pyright
- name: test with pytest
run:
pytest tests