diff --git a/.github/workflows/ratings.yml b/.github/workflows/ratings.yml index 0e1b2ac..8839bbd 100644 --- a/.github/workflows/ratings.yml +++ b/.github/workflows/ratings.yml @@ -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 diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index d23274c..2a86598 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -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 diff --git a/devenv.nix b/devenv.nix index 709d220..211ca63 100644 --- a/devenv.nix +++ b/devenv.nix @@ -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"; + }; }