-
Notifications
You must be signed in to change notification settings - Fork 1
50 lines (39 loc) · 2.02 KB
/
centos.yaml
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
name: BLOOM CentOS
on:
push:
branches:
- 'main'
tags:
- '*'
pull_request:
branches:
- '**'
jobs:
centos9-job:
runs-on: ubuntu-latest # We use the default GitHub runner to start a Docker container
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Docker
uses: docker/setup-buildx-action@v2
- name: Build and run CentOS 9 compatible container
run: |
docker run --name rocky9-container -d rockylinux:9 sleep infinity
docker exec rocky9-container yum install -y python3 python3-pip wget
docker exec rocky9-container python3 -m pip install --upgrade pip
# Create a user named 'bloom' and switch to this user
docker exec rocky9-container useradd -m bloom
# Install Miniconda for user 'bloom'
docker exec rocky9-container su - bloom -c "wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh"
docker exec rocky9-container su - bloom -c "bash /tmp/miniconda.sh -b -p /home/bloom/miniconda"
docker exec rocky9-container su - bloom -c "echo 'export PATH=/home/bloom/miniconda/bin:$PATH' >> /home/bloom/.bashrc"
docker exec rocky9-container su - bloom -c "/home/bloom/miniconda/bin/conda init"
# Source the conda script and create conda environment
docker exec rocky9-container su - bloom -c "source /home/bloom/.bashrc && conda create -n BLOOM2 python=3.12.0 pip -y"
# Copy repository content to container
docker cp . rocky9-container:/home/bloom/workspace
docker exec rocky9-container chown -R bloom:bloom /home/bloom/workspace
# Run the setup script and tests
docker exec rocky9-container su - bloom -c "cd /home/bloom/workspace && source /home/bloom/.bashrc && source bloom_lims/env/install_postgres.sh && pytest"
- name: Clean up Docker container
run: docker rm -f rocky9-container