Skip to content

CI: Skip intermediate jobs, in order to save CI time (#152) #53

CI: Skip intermediate jobs, in order to save CI time (#152)

CI: Skip intermediate jobs, in order to save CI time (#152) #53

Workflow file for this run

# Make a single PR that updates all of the manifest files
name: Single PR
on:
push:
branches:
- main
workflow_dispatch:
defaults:
run:
shell: bash
concurrency:
# Skip intermediate builds: all builds except for builds on the `main` branch
# Cancel intermediate builds: only pull request builds
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/main' || github.run_number }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
jobs:
update_each_manifest:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
version:
- '1.6' # old LTS
- '1.7'
- '1.8'
- '1.9'
- '1.10' # current LTS
- '1.11'
# - '1.12'
# - '1.13'
- 'nightly'
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
arch: x64
- run: println("::set-output name=manifest_version::$(VERSION.major).$(VERSION.minor)")
shell: julia --color=yes {0}
id: manifest_version
- run: echo "We will update the manifest at Manifest.${{ steps.manifest_version.outputs.manifest_version }}.toml"
- run: rm -rf Manifest.toml
- run: |
if [ -f "Manifest.${{ steps.manifest_version.outputs.manifest_version }}.toml" ]; then
echo "The manifest file exists, so I will update the existing manifest."
mv Manifest.${{ steps.manifest_version.outputs.manifest_version }}.toml Manifest.toml
else
echo "The manifest file does not exist, so I will create a new manifest from scratch."
fi
- name: Cache artifacts
uses: actions/cache@v4
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Manifest.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- run: julia --color=yes -e 'import Pkg; Pkg.Registry.add("General")'
env:
JULIA_PKG_SERVER: ""
- run: julia --color=yes -e 'import Pkg; Pkg.Registry.update()'
- run: julia --color=yes --project=@. -e 'import Pkg; Pkg.instantiate'
- run: julia --color=yes --project=@. -e 'import Pkg; Pkg.update()'
- run: mv Manifest.toml Manifest.${{ steps.manifest_version.outputs.manifest_version }}.toml
- run: git status
- uses: actions/upload-artifact@v4
with:
name: manifest_file_for_${{ steps.manifest_version.outputs.manifest_version }}
path: Manifest.${{ steps.manifest_version.outputs.manifest_version }}.toml
if-no-files-found: error
make_single_pr:
needs: update_each_manifest
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
- run: rm -rf /tmp/manifest_updater
- run: mkdir /tmp/manifest_updater
- run: chmod 700 /tmp/manifest_updater
- uses: actions/download-artifact@v4
with:
path: /tmp/manifest_updater/download_artifacts
- run: mv /tmp/manifest_updater/download_artifacts/manifest_file_for_*/Manifest.*.toml .
- run: rm -rf /tmp/manifest_updater
- run: rm -rf Manifest.toml
- run: chmod 600 Project.toml
- run: chmod 600 Manifest.*.toml
- run: git status
- uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
with:
token: ${{ secrets.GITHUB_TOKEN }}
delete-branch: true
branch: 'update_manifests/single_pr/all_manifests'
commit-message: '🤖 Update one or more manifest files'
title: '🤖 Update one or more manifest files'
body: ''