Add initial variable processing #114
Workflow file for this run
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: html-build CI | |
| on: | |
| pull_request: | |
| branches: ['main'] | |
| push: | |
| branches: ['main'] | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: ${{ github.repository }} | |
| jobs: | |
| static-checks: | |
| name: Static Checks | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout whatwg/html-build | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: stable | |
| components: rustfmt, clippy | |
| - name: Cache Cargo dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| target/ | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Check formatting | |
| run: cargo fmt --check | |
| - name: Run clippy | |
| run: cargo clippy -- -D warnings | |
| - name: Run tests | |
| run: cargo test | |
| - name: Shellcheck | |
| run: | | |
| shellcheck *.sh | |
| shellcheck ci-build/*.sh | |
| build-and-publish: | |
| name: Build and Publish | |
| runs-on: ubuntu-latest | |
| needs: [static-checks] | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout whatwg/html-build | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Docker build | |
| run: ci-build/docker-build.sh | |
| - name: Checkout whatwg/html | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: whatwg/html | |
| path: html | |
| fetch-depth: 2 | |
| - name: Test against whatwg/html | |
| run: | | |
| mkdir output | |
| bash ci-build/docker-run.sh "$GITHUB_WORKSPACE/html" output | |
| - name: Docker login | |
| if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Docker push | |
| if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
| run: | | |
| docker tag "$REGISTRY/$IMAGE_NAME" "$REGISTRY/$IMAGE_NAME:$GITHUB_SHA" | |
| docker tag "$REGISTRY/$IMAGE_NAME" "$REGISTRY/$IMAGE_NAME:latest" | |
| docker push "$REGISTRY/$IMAGE_NAME:$GITHUB_SHA" | |
| docker push "$REGISTRY/$IMAGE_NAME:latest" |