diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 2cfdd2a2..4c0f96d2 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -9,11 +9,14 @@ jobs: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 + - name: Set up Python uses: actions/setup-python@v5 with: python-version: 3.11 + - run: make install && make html #TESTING + - name: Deploy built directory to openfisca.org website uses: peaceiris/actions-gh-pages@v4 with: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index a4a0c0b5..00000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,81 +0,0 @@ -name: Main -on: - push: - branches: - - main - pull_request: - branches: - - main -jobs: - lint: - container: node-lts - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3.3.0 - - - name: Lint Markdown files - run: make lint - - build: - container: python:3.8 - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3.3.0 - - - name: Restore cache - uses: ylemkimon/cache-restore@v2.1.3 - with: - key: dependency-cache-${{ hashFiles('**/requirements.txt') }} - path: /tmp/venv/openfisca_doc - - - name: Create a virtualenv - run: | - mkdir -p /tmp/venv/openfisca_doc - python -m venv /tmp/venv/openfisca_doc - echo "source /tmp/venv/openfisca_doc/bin/activate" >> $BASH_ENV - - - name: Install doc dependencies - run: make install - - - name: Save cache - uses: actions/cache@v3.2.4 - with: - key: dependency-cache-${{ hashFiles('**/requirements.txt') }} - path: /tmp/venv/openfisca_doc - - - name: Test doc - run: make test-build - - - name: Build doc - run: make html - - - name: Serve doc - run: make prod & - - - name: Check for internal dead links - run: wget --spider --recursive --page-requisites http://localhost:8000 - - - name: Upload artifact result for build job - uses: actions/upload-artifact@v3 - with: - name: build-artifact - path: build - - deploy: - container: python:3.8 - runs-on: ubuntu-latest - needs: build - steps: - - name: Checkout - uses: actions/checkout@v3.3.0 - - - name: Download math result for job 1 - uses: actions/download-artifact@v3 - with: - name: build-artifact - - - name: Publish openfisca.org/doc - run: ./publish.sh - diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..3e8262ff --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,47 @@ +name: Test + +on: + pull_request: + push: # TESTING + +jobs: + lint: + container: node-lts + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Lint Markdown files + run: make lint + + build: + container: python:3.11 + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Cache dependencies + uses: actions/cache@v4 + with: + path: ${{ env.pythonLocation }} + key: build-${{ env.pythonLocation }}-${{ hashFiles('requirements.txt') }}-${{ github.sha }} # Cache the entire build Python environment + restore-keys: | + build-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }} + build-${{ env.pythonLocation }}- + + - name: Install dependencies + run: make install + + - name: Test doc + run: make test-build + + - name: Build doc + run: make html + + - name: Serve doc + run: make prod & + + - name: Check for internal dead links + run: wget --retry-connrefused --waitretry=1 --spider --recursive --page-requisites http://localhost:8000