Skip to content

Commit

Permalink
update github actions to run with devenv
Browse files Browse the repository at this point in the history
  • Loading branch information
pogopaule committed Mar 8, 2024
1 parent eb9b9c5 commit e941bfc
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 18 deletions.
24 changes: 16 additions & 8 deletions .github/workflows/ratings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,29 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2.4.0
uses: actions/checkout@v4.1.1

- name: Install Nix
uses: cachix/install-nix-action@v18
uses: cachix/install-nix-action@v26

- name: Use Cachix
uses: cachix/cachix-action@v12
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
name: devenv

- name: Install devenv.sh
run: nix profile install --accept-flake-config tarball+https://install.devenv.sh/latest

- name: Build the devenv shell and run any pre-commit hooks
run: devenv ci

- name: Run tests
run: cd src && nix develop .#test -c pytest
run: devenv shell run_tests

- name: Run update_reviews.py
run: cd src && nix develop .#reviews -c python update_reviews.py
- name: Run update_reviews
run: devenv shell update_reviews

- name: Add & Commit
uses: EndBug/add-and-commit@v7.1.0
uses: EndBug/add-and-commit@v9.1.4
with:
message: update data.yaml via update_reviews.py
30 changes: 20 additions & 10 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,36 @@ jobs:
update_readme_and_map:
runs-on: ubuntu-latest



steps:
- name: Checkout
uses: actions/checkout@v2.4.0
uses: actions/checkout@v4.1.1

- name: Install Nix
uses: cachix/install-nix-action@v18
uses: cachix/install-nix-action@v26

- name: Use Cachix
uses: cachix/cachix-action@v12
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
name: devenv

- name: Install devenv.sh
run: nix profile install --accept-flake-config tarball+https://install.devenv.sh/latest

- name: Build the devenv shell and run any pre-commit hooks
run: devenv ci

- name: Run tests
run: cd src && nix develop .#test -c pytest
run: devenv shell run_tests

- name: Run create_readme.py
run: cd src && nix develop .#readmeAndMap -c python create_readme.py
- name: Run create_readme
run: devenv shell create_readme

- name: Run create_map_data.py
run: cd src && nix develop .#readmeAndMap -c python create_map_data.py
- name: Run create_map_data
run: devenv shell create_map_data

- name: Add & Commit
uses: EndBug/add-and-commit@v7.1.0
uses: EndBug/add-and-commit@v9.1.4
with:
message: update readme.md via create_readme.py
19 changes: 19 additions & 0 deletions devenv.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,23 @@
'';
};
};

scripts = {
create_readme.exec = ''
pushd src > /dev/null
python create_readme.py
popd > /dev/null
'';
create_map_data.exec = ''
pushd src > /dev/null
python create_map_data.py
popd > /dev/null
'';
update_reviews.exec = ''
pushd src > /dev/null
python update_reviews.py
popd > /dev/null
'';
test.exec = "pytest src/test_all.py";
};
}

0 comments on commit e941bfc

Please sign in to comment.