Update package repositories #677
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Update package repositories | |
| on: | |
| schedule: | |
| - cron: 0 3 * * * | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| env: | |
| PHARMAPKGS_REMOTE_REPO: https://cloud.r-project.org/ | |
| PHARMAPKGS_LOCAL_REPO: ${{ github.workspace }} | |
| PHARMAPKGS_LIMIT: ${{ vars.PHARMAPKGS_LIMIT || 100}} | |
| PHARMAPKGS_EXCLUDED_METRICS: ${{ vars.PHARMAPKGS_EXCLUDED_METRICS || 'assess_covr_coverage,assess_r_cmd_check' }} | |
| LOGGER_LOG_LEVEL: DEBUG | |
| jobs: | |
| main: | |
| strategy: | |
| matrix: | |
| platform: [ubuntu-22.04] | |
| r_version: ["4.4"] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: r-lib/actions/setup-r@v2 | |
| - uses: r-lib/actions/setup-r-dependencies@v2 | |
| with: | |
| install-quarto: false | |
| - uses: quarto-dev/quarto-actions/setup@v2 | |
| - name: Unpack existing reports | |
| working-directory: src/contrib/Meta | |
| run: | | |
| tar xzf reports.tar.gz | |
| rm reports.tar.gz | |
| - name: Build pharmapkgs | |
| env: | |
| PHARMAPKGS_PLATFORM: ${{ matrix.platform }} | |
| PHARMAPKGS_R_VERSION: ${{ matrix.r_version }} | |
| run: R CMD build . | |
| - name: Install pharmapkgs | |
| env: | |
| PHARMAPKGS_PLATFORM: ${{ matrix.platform }} | |
| PHARMAPKGS_R_VERSION: ${{ matrix.r_version }} | |
| run: R CMD INSTALL pharmapkgs_*.tar.gz | |
| - name: Update package repositories | |
| env: | |
| PHARMAPKGS_PLATFORM: ${{ matrix.platform }} | |
| PHARMAPKGS_R_VERSION: ${{ matrix.r_version }} | |
| shell: Rscript {0} | |
| run: | | |
| library("pharmapkgs") | |
| github_actions() | |
| - name: Compress reports | |
| working-directory: src/contrib/Meta | |
| run: | | |
| tar czf reports.tar.gz *.md | |
| rm *.md | |
| # - name: Setup tmate session | |
| # if: ${{ failure() }} | |
| # uses: mxschmitt/action-tmate@v3 | |
| # timeout-minutes: 15 | |
| - uses: stefanzweifel/git-auto-commit-action@v5 | |
| with: | |
| commit_message: "Auto-update: ${{matrix.platform}}, R-${{matrix.r_version}}" | |
| file_pattern: ${{ github.workspace }}/src/contrib/Meta/*.tar.gz ${{ github.workspace }}/src/contrib/PACKAGES | |
| add_options: '-u' | |
| - name: Remove untracked files | |
| run: git clean -fdx |