-
Notifications
You must be signed in to change notification settings - Fork 2
141 lines (114 loc) · 3.98 KB
/
desc-python-bleed.yml
File metadata and controls
141 lines (114 loc) · 3.98 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
name: desc-python bleed
on:
push:
branches:
- bleed
workflow_dispatch:
schedule:
- cron: '45 20 * * 0'
env:
TEST_TAG: lsstdesc/desc-python:bleed-dev
jobs:
build:
name: Build on Ubuntu
runs-on: ubuntu-22.04
steps:
# https://github.com/jlumbroso/free-disk-space/issues/14
- name: Update Package List and Remove Dotnet
run: |
sudo apt-get update
sudo apt-get remove -y '^dotnet-.*'
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false
# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- name: Aggressive cleanup
run: |
# Remove Java (JDKs)
sudo rm -rf /usr/lib/jvm
# Remove .NET SDKs
sudo rm -rf /usr/share/dotnet
# Remove Swift toolchain
sudo rm -rf /usr/share/swift
# Remove Haskell (GHC)
sudo rm -rf /usr/local/.ghcup
# Remove Julia
sudo rm -rf /usr/local/julia*
# Remove Android SDKs
sudo rm -rf /usr/local/lib/android
# Remove Chromium (optional if not using for browser tests)
sudo rm -rf /usr/local/share/chromium
# Remove Microsoft/Edge and Google Chrome builds
sudo rm -rf /opt/microsoft /opt/google
# Remove Azure CLI
sudo rm -rf /opt/az
# Remove PowerShell
sudo rm -rf /usr/local/share/powershell
# Remove CodeQL and other toolcaches
sudo rm -rf /opt/hostedtoolcache
docker system prune -af || true
docker builder prune -af || true
df -h
- name: Docker login
uses: docker/login-action@v3
with:
username: heather999
password: '${{ secrets.DOCKERHUB_ACCESSTOK }}'
- name: GHCR login
uses: docker/login-action@v3
with:
registry: ghcr.io
username: heather999
password: ${{ secrets.GHCR_TOKEN }}
- name: checkout desc-python
uses: actions/checkout@v4
with:
ref: bleed
- name : Get date
run: |
echo "DATE_TAG=$(date "+%F")" >> $GITHUB_ENV
echo $GITHUB_WORKSPACE
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
with:
buildkitd-flags: --debug
- name: Run on failure
if: failure() && steps.buildx.outcome == 'failure'
run: |
echo "Buildx setup failed!"
exit 1
- name: pull old build
run: |
docker pull lsstdesc/desc-python:bleed
docker tag lsstdesc/desc-python:bleed lsstdesc/desc-python:bleed-old
docker push lsstdesc/desc-python:bleed-old
- name: Build
id: docker_build
uses: docker/build-push-action@v5
with:
context: .
build-args: |
GH_SHA=${{ github.sha }}
GITHUB_WORKSPACE=${{ env.GITHUB_WORKSPACE }}
push: true
tags: ${{ env.TEST_TAG }}
- name: test image before pushing
run: |
docker run --rm ${{ env.TEST_TAG }} /bin/bash -c "source /opt/desc/bin/activate && python -c 'import astropy'"
docker tag ${{ env.TEST_TAG }} lsstdesc/desc-python:bleed-${{env.DATE_TAG}}
docker push lsstdesc/desc-python:bleed-${{env.DATE_TAG}}
docker tag ${{ env.TEST_TAG }} lsstdesc/desc-python:bleed
docker push lsstdesc/desc-python:bleed
docker tag ${{ env.TEST_TAG }} ghcr.io/lsstdesc/desc-python:bleed
docker push ghcr.io/lsstdesc/desc-python:bleed