-
Notifications
You must be signed in to change notification settings - Fork 38
75 lines (65 loc) · 2.46 KB
/
outputs.yml
File metadata and controls
75 lines (65 loc) · 2.46 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Generate outputs
on:
workflow_call:
inputs:
container_artifact:
required: true
type: boolean
jobs:
re-generate:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Remove pre-installed apps to make space for build
run: |
sudo apt-get remove -y '^llvm-.*'
sudo apt-get remove -y '^dotnet-.*'
sudo apt-get remove -y 'php.*'
sudo apt-get remove -y '^mongodb-.*'
sudo apt-get remove -y '^mysql-.*'
sudo apt-get autoremove -y
sudo apt-get clean
sudo rm -rf /usr/share/dotnet/
sudo rm -rf /usr/local/share/powershell
sudo rm -rf /usr/local/share/chromium
sudo rm -rf /usr/local/lib/android
sudo rm -rf /usr/local/lib/node_modules
sudo docker system prune -af
- 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 if was previously created
if: github.event_name == 'pull_request' && inputs.container_artifact
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
with:
name: tutorial-container
path: /tmp
- name: Import container from PR artifact
if: github.event_name == 'pull_request' && inputs.container_artifact
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
make -C outputs -j $(nproc) DOCKER_RUN_OPTS="-e COLUMNS=94 -e COLIFY_SIZE=24x94" container=ghcr.io/spack/tutorial
- name: Show diff of modified files
run: |
git diff HEAD .
- 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 .
git commit -m "Update generated outputs on behalf of [@${{ github.actor }}]"
git push