-
Notifications
You must be signed in to change notification settings - Fork 3
78 lines (72 loc) · 2.55 KB
/
Copy pathtest_service.yaml
File metadata and controls
78 lines (72 loc) · 2.55 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
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Tex2PDF Python application
on:
push:
branches: [ "master" ]
paths:
- 'tex2pdf-service/**'
pull_request:
branches: [ "master" ]
paths:
- 'tex2pdf-service/**'
env:
PROJECT_ID: 'arxiv-development'
AR_URL: 'gcr.io'
SERVICE_ACCOUNT: 'gha-worker@arxiv-development.iam.gserviceaccount.com'
WORKLOAD_IDENTITY_PROVIDER: 'projects/874717964009/locations/global/workloadIdentityPools/github/providers/github-actions-provider'
jobs:
build:
permissions:
contents: 'read'
id-token: 'write'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: setup gvisor
run: |
set -e
ARCH=$(uname -m)
URL=https://storage.googleapis.com/gvisor/releases/release/latest/${ARCH}
wget ${URL}/runsc ${URL}/runsc.sha512 \
${URL}/containerd-shim-runsc-v1 ${URL}/containerd-shim-runsc-v1.sha512
sha512sum -c runsc.sha512 -c containerd-shim-runsc-v1.sha512
rm -f *.sha512
chmod a+rx runsc containerd-shim-runsc-v1
sudo cp runsc containerd-shim-runsc-v1 /usr/local/bin
rm runsc containerd-shim-runsc-v1
sudo /usr/local/bin/runsc install
sudo systemctl reload docker
- name: Google Auth
id: auth
uses: 'google-github-actions/auth@v2'
with:
token_format: 'access_token'
project_id: ${{ env.PROJECT_ID }}
service_account: ${{ env.SERVICE_ACCOUNT }}
workload_identity_provider: ${{ env.WORKLOAD_IDENTITY_PROVIDER }}
- name: Docker Auth
id: docker-auth
uses: 'docker/login-action@v1'
with:
username: 'oauth2accesstoken'
password: '${{ steps.auth.outputs.access_token }}'
registry: ${{ env.AR_URL }}
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install dependencies for tex2pdf
run: |
cd tex2pdf-service
python -m pip install --upgrade pip
pip install pytest poetry
poetry install
# Overlay the in-tree tex2pdf-tools so CI tests against the working
# copy, not the GitHub-pinned commit recorded in poetry.lock.
poetry run pip install --no-deps -e ../tex2pdf-tools
- name: pytest for tex2pdf
run: |
cd tex2pdf-service
export PYTHONPATH=$PWD
poetry run pytest tests