Merge pull request #413 from headwaymaps/mkirk/update-planet-260420 #651
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: Build Check | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| merge_group: | |
| jobs: | |
| build_data: | |
| name: Build Bogota data artifacts | |
| runs-on: ubuntu-latest | |
| env: | |
| DAGGER_NO_NAG: 1 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install Dagger | |
| uses: dagger/dagger-for-github@v8.2.0 | |
| with: | |
| version: "latest" | |
| - name: Copy .bin-env | |
| run: cp .bin-env-example .bin-env | |
| - name: Build data artifacts | |
| run: bin/build builds/Bogota | |
| - name: Upload data artifacts | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: bogota-artifacts-${{ github.sha }} | |
| path: data/Bogota | |
| retention-days: 7 | |
| build_images: | |
| name: Build service images | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install Dagger | |
| uses: dagger/dagger-for-github@v8.2.0 | |
| with: | |
| version: "latest" | |
| - name: Build service images | |
| run: bin/build-images | |
| - name: Save Docker images | |
| run: | | |
| docker save $(docker images --format "{{.Repository}}:{{.Tag}}" | grep headway) | gzip > docker-images.tar.gz | |
| - name: Upload Docker images | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: docker-images-${{ github.sha }} | |
| path: docker-images.tar.gz | |
| retention-days: 7 | |
| www_checks: | |
| defaults: | |
| run: | |
| working-directory: services/frontend/www-app | |
| name: Frontend checks | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - run: npm install --global yarn | |
| - run: yarn install | |
| - run: yarn quasar prepare | |
| - run: yarn lint | |
| - run: yarn format-check | |
| - run: yarn tsc | |
| - run: yarn test | |
| travelmux_checks: | |
| defaults: | |
| run: | |
| working-directory: services/travelmux | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy, rustfmt | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| services/travelmux/target/ | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| - run: cargo fmt --all --check | |
| - run: cargo clippy --all-features | |
| - run: cargo test --all-targets | |
| - run: cargo build --release | |
| gtfout: | |
| defaults: | |
| run: | |
| working-directory: services/gtfs/gtfout | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy, rustfmt | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| services/travelmux/target/ | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| - run: cargo fmt --all --check | |
| - run: cargo clippy --all-targets --all-features | |
| - run: cargo test --all-targets --all-features | |
| - run: cargo build --release | |
| integration_tests: | |
| name: Integration Tests | |
| runs-on: ubuntu-latest | |
| needs: [build_data, build_images] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install jq | |
| run: sudo apt-get update && sudo apt-get install -y jq | |
| - name: Download data artifacts | |
| uses: actions/download-artifact@v6 | |
| with: | |
| name: bogota-artifacts-${{ github.sha }} | |
| path: data/Bogota | |
| - name: Download Docker images | |
| uses: actions/download-artifact@v6 | |
| with: | |
| name: docker-images-${{ github.sha }} | |
| path: . | |
| - name: Load Docker images | |
| run: gunzip -c docker-images.tar.gz | docker load | |
| - name: Run integration tests | |
| run: tests/integration/run-integration-tests.sh builds/Bogota | |
| - name: Collect logs on failure | |
| if: failure() | |
| run: docker compose logs > integration-test-logs.txt | |
| - name: Upload logs | |
| if: failure() | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: integration-test-logs | |
| path: integration-test-logs.txt |