-
Notifications
You must be signed in to change notification settings - Fork 13
61 lines (56 loc) · 1.79 KB
/
build-gtfs-rt-parser-v2-image.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: Build and push gtfs-rt-parser-v2 image
on:
push:
branches:
- 'main'
paths:
- '.github/workflows/build-gtfs-rt-parser-v2-image.yml'
- 'jobs/gtfs-rt-parser-v2/**'
pull_request:
paths:
- '.github/workflows/build-gtfs-rt-parser-v2-image.yml'
- 'jobs/gtfs-rt-parser-v2/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check:
name: Run static checkers
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
with:
python-version: '3.9'
- run: curl -sSL https://install.python-poetry.org | python -
- run: cd jobs/gtfs-rt-parser-v2 && poetry install && poetry run mypy .
test:
name: Run pytest
runs-on: ubuntu-latest
env:
CALITP_BUCKET__GTFS_RT_PARSED: gs://some-test-bucket
CALITP_BUCKET__GTFS_RT_VALIDATION: gs://some-test-bucket
GTFS_RT_VALIDATOR_VERSION: v0.0.0
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
with:
python-version: '3.9'
- run: curl -sSL https://install.python-poetry.org | python -
- run: cd jobs/gtfs-rt-parser-v2 && poetry install && poetry run pytest
build_push:
name: Package docker image
runs-on: ubuntu-latest
needs: [check, test]
steps:
- uses: actions/checkout@v2
- uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v2
with:
context: jobs/gtfs-rt-parser-v2
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
tags: ghcr.io/${{github.repository}}/gtfs-rt-parser-v2:latest