-
Notifications
You must be signed in to change notification settings - Fork 38
61 lines (52 loc) · 2 KB
/
outputs.yml
File metadata and controls
61 lines (52 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Generate outputs
on:
workflow_call:
inputs:
with_pr_container:
required: true
type: boolean
jobs:
re-generate:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout (Push)
if: github.event_name != 'pull_request'
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
with:
ref: ${{ github.head_ref }}
- name: Checkout (PR)
if: github.event_name == 'pull_request'
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Download container from artifact if PR
if: github.event_name == 'pull_request' && inputs.with_pr_container
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
with:
name: tutorial-container
path: /tmp
- name: Import container from PR artifact
if: github.event_name == 'pull_request' && inputs.with_pr_container
run: |
docker load --input /tmp/tutorial-container.tar
docker image ls -a
- name: Re-generate outputs from tutorial scripts
run: |
chmod -R a+w outputs
mkdir spack-home && sudo chown -R 1000:1000 spack-home
DOCKER_RUN_OPTS="-e COLUMNS=94 -e COLIFY_SIZE=24x94 -v $(pwd)/spack-home:/home/spack"
make -C outputs -j $(nproc) DOCKER_RUN_OPTS="$DOCKER_RUN_OPTS" container=ghcr.io/spack/tutorial
- name: Show diff of modified files
run: |
git diff HEAD outputs/
- name: Push modified files to branch
if: ( github.event_name == 'pull_request' && ! github.event.pull_request.head.repo.fork )
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add outputs/
git commit -m "Update generated outputs on behalf of [@${{ github.actor }}]"
git push