generated from actions/container-action
-
Notifications
You must be signed in to change notification settings - Fork 4
87 lines (84 loc) · 3.42 KB
/
python-demo.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
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
name: Docker-based CI
on:
push:
branches:
- master # forall push/merge in master
- v1 # forall push/merge in v1
pull_request:
branches:
- "**" # forall submitted Pull Requests
schedule:
# test master every day at 16:00 UTC
# cf. https://crontab.guru/
- cron: '0 16 * * *'
jobs:
# ######################################################################
# This job illustrates the fact that docker-coq-action is "coq-agnostic"
# and can be used with any Docker image.
#
# The two fields that are required to address this use case are:
# https://github.com/coq-community/docker-coq-action#custom_image
# https://github.com/coq-community/docker-coq-action#custom_script
# ######################################################################
python-demo:
name: custom_image / python:3
runs-on: ubuntu-latest
steps:
################################################################
# Begin GHA_TEST_ENV # You should remove this GHA_TEST_ENV block
# # if you copy this demo workflow elsewhere!
- uses: actions/checkout@v4
with:
repository: 'erikmd/poc-github-ci'
ref: 'master'
- uses: actions/checkout@v4
with:
path: 'docker-coq-action'
- uses: './docker-coq-action'
# End GHA_TEST_ENV
##################
# - uses: actions/checkout@v4
# - uses: coq-community/docker-coq-action@v1
with:
custom_image: 'python:3'
custom_script: |
python --version
startGroup "Install dependencies"
pip install --no-cache-dir --upgrade pip
pip install --no-cache-dir -r requirements.txt
endGroup
startGroup "Run tests"
pytest *.py
endGroup
# in case there is a permission mismatch issue at GHA cleanup time,
# see https://github.com/coq-community/docker-coq-action#permissions
# ######################################################################
# This job illustrates how to run a docker command before the entrypoint
# ######################################################################
entrypoint-demo:
name: entrypoint / custom_image / python:3
runs-on: ubuntu-latest
env:
REGISTRY: docker.io
IMAGE_NAME: python
IMAGE_TAG: 3
steps:
################################################################
# Begin GHA_TEST_ENV # You should remove this GHA_TEST_ENV block
# # if you copy this demo workflow elsewhere!
- uses: actions/checkout@v4
with:
path: 'docker-coq-action'
- uses: './docker-coq-action'
# End GHA_TEST_ENV
##################
# - uses: actions/checkout@v4
# - uses: coq-community/docker-coq-action@v1
with:
entrypoint: /bin/sh
# see also https://github.com/coq-community/docker-coq-action/issues/80#issuecomment-1321272915
# args: -c "/bin/echo \"${{ secrets.GITHUB_TOKEN }}\" | docker login ${{ env.REGISTRY }} -u ${{ github.actor }} --password-stdin && exec /app/entrypoint.sh \"$@\"" sh
args: -c "docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }} && exec /app/entrypoint.sh \"$@\"" sh
custom_image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
custom_script: |
python --version