Merge pull request #132 from OneBusAway/stop-consolidation #193
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| jobs: | |
| renderer: | |
| name: Template renderer tests | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.22" | |
| - name: Run renderer tests | |
| working-directory: oba/config/template_renderer | |
| run: go test ./... | |
| bundle_script: | |
| name: build_bundle.sh unit tests | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| - name: Guard - oba and bundler scripts identical | |
| run: diff oba/build_bundle.sh bundler/build_bundle.sh | |
| - name: Run script tests | |
| run: bash bin/build_bundle_test.sh | |
| bundle_inputs_integration: | |
| name: Bundle inputs integration (real builder) | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| - name: Build oba image | |
| run: | | |
| docker buildx build \ | |
| --load \ | |
| -t oba-image:latest \ | |
| ./oba | |
| - name: Run integration test | |
| timeout-minutes: 20 | |
| run: | | |
| chmod +x bin/bundle_inputs_integration_test.sh bin/testdata/build_bundle/make_fixtures.sh | |
| bash bin/bundle_inputs_integration_test.sh | |
| image: | |
| name: Build Docker Image | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v1 | |
| - name: Build bundler image | |
| run: | | |
| docker buildx build \ | |
| --load \ | |
| -t bundler-image:latest \ | |
| ./bundler | |
| - name: Build oba image | |
| run: | | |
| docker buildx build \ | |
| --load \ | |
| -t oba-image:latest \ | |
| ./oba | |
| services: | |
| name: Services with Bundler | |
| runs-on: ubuntu-latest | |
| # Build against a small committed GTFS fixture served on the compose network | |
| # instead of the live Unitrans feed, so this job is deterministic. See | |
| # docker-compose.ci.yml and bin/testdata/services/make_services_fixture.sh. | |
| env: | |
| COMPOSE_FILE: docker-compose.yml:docker-compose.ci.yml | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Build bundle | |
| run: | | |
| docker compose up oba_bundler | |
| - name: Docker Compose up | |
| run: | | |
| docker compose up -d | |
| - name: Wait for services to be up | |
| run: sleep 30 | |
| - name: Test the services | |
| timeout-minutes: 10 | |
| run: | | |
| chmod +x ./bin/validate.sh | |
| ./bin/validate.sh | |
| - name: Docker Compose down | |
| if: always() | |
| run: docker compose down | |
| services_standalone: | |
| name: Services standalone | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| contents: read | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Docker Compose up | |
| run: | | |
| docker compose -f docker-compose.standalone.yml up -d | |
| - name: Wait for services to be up | |
| # leave time to download and process the GTFS data | |
| run: sleep 60 | |
| - name: Test the services | |
| timeout-minutes: 10 | |
| run: | | |
| chmod +x ./bin/validate.sh | |
| ./bin/validate.sh | |
| # - name: Breakpoint if tests failed | |
| # if: failure() | |
| # uses: namespacelabs/breakpoint-action@v0 | |
| # with: | |
| # duration: 30m | |
| # authorized-users: aaronbrethorst | |
| - name: Docker Compose down | |
| if: always() | |
| run: docker compose down |