-
Notifications
You must be signed in to change notification settings - Fork 2
54 lines (51 loc) · 2 KB
/
desc-python-bleed-pr.yml
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
name: desc-python-bleed-pr
on:
pull_request:
branches:
- bleed
workflow_dispatch:
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: Check Disk Space
run: df -h && sudo apt-get clean && df -h
- name: Docker login
run: echo '${{ secrets.DOCKERHUB_ACCESSTOK }}' | docker login --username heather999 --password-stdin
- name: checkout desc-stack
uses: actions/checkout@v2
with:
ref: ''
fetch-depth: 1
- name : Docker prune
run: sudo docker system prune && df -h
- name : Get weekly number and date
run: |
echo "DATE_TAG=$(date "+%F")" >> $GITHUB_ENV
echo "PR_NUM=${{github.event.number}}" >> $GITHUB_ENV
- name: do docker build
run: docker build --no-cache --build-arg PR_BRANCH=$GITHUB_HEAD_REF -t lsstdesc/desc-python:bleed-pr${{env.PR_NUM}}-${{env.DATE_TAG}} -f $GITHUB_WORKSPACE/Dockerfile .
- name: test pyccl
run: docker run --rm lsstdesc/desc-python:bleed-pr${{env.PR_NUM}}-${{env.DATE_TAG}} /bin/bash -c "source /usr/local/py/etc/profile.d/conda.sh && conda activate desc && python -c 'import pyccl'"
- name: Docker push
run: docker push lsstdesc/desc-python:bleed-pr${{env.PR_NUM}}-${{env.DATE_TAG}}