generated from skills/code-with-codespaces
-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (59 loc) · 1.79 KB
/
main.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
55
56
57
58
59
60
61
name: Tests
on:
workflow_dispatch:
jobs:
test1:
runs-on: ubuntu-latest
container: ubuntu:22.04
env:
PIP_ROOT_USER_ACTION: ignore
strategy:
matrix:
python: [3.12.6]
steps:
- uses: actions/checkout@v4
- name: List environment variables
run: printenv
- name: Print Container ID and Environment Variable
run: |
# Get the container ID
container_id=$(cat /proc/self/cgroup | grep "cpu" | sed 's/^.*\///' | tail -n 1)
echo "Container ID used: $container_id"
# Print the environment variable
echo "PRINT PIP_ROOT_USER_ACTION: $PIP_ROOT_USER_ACTION"
- name: Install Docker
run: |
apt-get update
apt-get install -y docker.io
- name: Install lsb-release
run: |
apt-get update
apt-get install -y lsb-release
- name: fix pip issue
run: mkdir -p /github/home/.cache/pip
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
cache: 'pip'
cache-dependency-path: 'requirements.txt'
- name: Print again
run: |
# Get the container ID
container_id=$(cat /proc/self/cgroup | grep "cpu" | sed 's/^.*\///' | tail -n 1)
echo "Container ID used: $container_id"
# Print the environment variable
echo "PRINT PIP_ROOT_USER_ACTION: $PIP_ROOT_USER_ACTION"
test2:
runs-on: ubuntu-latest
strategy:
matrix:
python: [3.12.6]
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
cache: 'pip'
cache-dependency-path: 'requirements.txt'