-
Notifications
You must be signed in to change notification settings - Fork 38
60 lines (51 loc) · 1.86 KB
/
Copy pathoutputs.yml
File metadata and controls
60 lines (51 loc) · 1.86 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
name: Generate outputs
on:
workflow_call:
inputs:
with_pr_container:
required: true
type: boolean
jobs:
re-generate:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout (Push)
if: github.event_name != 'pull_request'
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.head_ref }}
- name: Checkout (PR)
if: github.event_name == 'pull_request'
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
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@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v4.1.7
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 chmod -R a+rwx 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: Upload outputs as artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v4.3.1
with:
name: generated-outputs
path: outputs/
retention-days: 7
compression-level: 9