diff --git a/.github/workflows/update-bam-example-data.yml b/.github/workflows/update-bam-example-data.yml new file mode 100644 index 00000000..d8101a72 --- /dev/null +++ b/.github/workflows/update-bam-example-data.yml @@ -0,0 +1,39 @@ +# Update example data when convert_output.R or variable-name resources change +name: update-bam-example-data +on: + pull_request: + branches: [main] + paths: + - 'R/conout_bam.R' + - 'inst/resources/bam_var_names.csv' + workflow_dispatch: +jobs: + update-example-data: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + with: + repository: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name || github.repository }} + ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.ref_name }} + + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::pak, any::usethis, local::. + + - name: Update example data + run: Rscript data-raw/DATASET_BAM.R + + - name: Commit and push updated example data + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository + run: | + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git add data/vermilion_snapper.rda + git diff --cached --quiet || git commit -m "chore: update BAM vermilion snapper example from converter resource changes (triggered by $(git log -1 --pretty=format:'%h %s' HEAD)) [skip ci]" + git push diff --git a/.github/workflows/update-example-data.yml b/.github/workflows/update-example-data.yml new file mode 100644 index 00000000..02244c4b --- /dev/null +++ b/.github/workflows/update-example-data.yml @@ -0,0 +1,39 @@ +# Update ss3 example data from Report.sso when convert_output.R or variable-name resources change +name: update-example-data +on: + pull_request: + branches: [main] + paths: + - 'R/conout_ss3.R' + - 'inst/resources/ss3_var_names.csv' + workflow_dispatch: +jobs: + update-example-data: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + with: + repository: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name || github.repository }} + ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.ref_name }} + + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::pak, any::usethis, local::. + + - name: Update example data + run: Rscript data-raw/DATASET.R + + - name: Commit and push updated example data + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository + run: | + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git add data/example_data.rda + git diff --cached --quiet || git commit -m "chore: update SS3 example_data from converter resource changes (triggered by $(git log -1 --pretty=format:'%h %s' HEAD)) [skip ci]" + git push diff --git a/.github/workflows/update-rceattle-example-data.yml b/.github/workflows/update-rceattle-example-data.yml index d9ba8e6e..97f6ebd2 100644 --- a/.github/workflows/update-rceattle-example-data.yml +++ b/.github/workflows/update-rceattle-example-data.yml @@ -1,10 +1,10 @@ -# Update example data when convert_output.R or variable-name resources change +# Update Rceattle example data when convert_output.R or variable-name resources change name: update-rceattle-example-data on: pull_request: branches: [main] paths: - - 'R/convert_output.R' + - 'R/conout_rceattle.R' - 'inst/resources/rceattle_var_names.csv' workflow_dispatch: jobs: diff --git a/.github/workflows/update-ss3-example-data.yml b/.github/workflows/update-ss3-example-data.yml index 6dca7f56..789c187f 100644 --- a/.github/workflows/update-ss3-example-data.yml +++ b/.github/workflows/update-ss3-example-data.yml @@ -1,14 +1,11 @@ -# Update example data when convert_output.R or variable-name resources change -name: update-example-data +# Update ss3 example data from r4ss object when convert_output.R or variable-name resources change +name: update-ss3-example-data on: pull_request: branches: [main] paths: - - 'R/convert_output.R' - - 'inst/resources/bam_var_names.csv' + - 'R/conout_ss3.R' - 'inst/resources/ss3_var_names.csv' - - 'inst/resources/rceattle_var_names.csv' - - 'inst/resources/fims_var_names.csv' workflow_dispatch: jobs: update-example-data: @@ -30,13 +27,13 @@ jobs: extra-packages: any::pak, any::usethis, local::. - name: Update example data - run: Rscript data-raw/DATASET.R + run: Rscript data-raw/DATASET_SS3.R - name: Commit and push updated example data if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository run: | git config user.name "github-actions[bot]" git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - git add data/example_data.rda - git diff --cached --quiet || git commit -m "chore: update example_data from converter resource changes (triggered by $(git log -1 --pretty=format:'%h %s' HEAD)) [skip ci]" + git add data/ss3_simple.rda + git diff --cached --quiet || git commit -m "chore: update SS3 r4ss example_data from converter resource changes (triggered by $(git log -1 --pretty=format:'%h %s' HEAD)) [skip ci]" git push