aligning logic #2287
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] | |
| jobs: | |
| hash: | |
| name: Get Docker Hash | |
| runs-on: ubuntu-latest | |
| outputs: | |
| hash: ${{ steps.hash.outputs.hash }} | |
| exists: ${{ steps.exists.outputs.exists }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| with: | |
| repository: cucapra/filament | |
| ref: ${{ github.sha }} | |
| fetch-depth: 0 | |
| - name: Get hash | |
| id: hash | |
| run: git log -s -n 1 --pretty=format:"%H" -- Dockerfile | echo "hash=$(cat)" >> "$GITHUB_OUTPUT" | |
| - name: Check if image exists | |
| id: exists | |
| run: (docker buildx imagetools inspect ghcr.io/cucapra/filament:${{ steps.hash.outputs.hash }} &> /dev/null && echo "exists=true" || echo "exists=false") >> "$GITHUB_OUTPUT" | |
| build: | |
| name: Build and Push Docker Image | |
| needs: hash | |
| if: ${{ needs.hash.outputs.exists == 'false' }} | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| packages: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| with: | |
| repository: cucapra/filament | |
| ref: ${{ needs.hash.outputs.hash }} | |
| - name: Login to GHCR | |
| uses: docker/login-action@v2 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Docker metadata | |
| id: meta | |
| uses: docker/metadata-action@v4 | |
| with: | |
| images: ghcr.io/cucapra/filament | |
| tags: | | |
| type=raw,value=${{ needs.hash.outputs.hash }},enable=true | |
| type=raw,value=latest,enable={{is_default_branch}} | |
| flavor: latest=false | |
| - uses: depot/setup-action@v1 | |
| - uses: depot/build-push-action@v1 | |
| with: | |
| context: . | |
| project: 7grh10615f | |
| platforms: linux/amd64 | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| compiler: | |
| name: Test Compiler | |
| runs-on: ubuntu-latest | |
| needs: [hash, build] | |
| if: always() && !failure() && !cancelled() | |
| container: ghcr.io/cucapra/filament:${{ needs.hash.outputs.hash }} | |
| steps: | |
| - name: Copy fud configuration | |
| run: | | |
| mkdir -p $HOME/.config | |
| cp -r /root/.config/* $HOME/.config | |
| - name: Checkout commit that triggered run | |
| uses: actions/checkout@v3 | |
| with: | |
| repository: cucapra/filament | |
| ref: ${{ github.sha }} | |
| - name: Reconfigure fud | |
| run: | | |
| fud register -p $GITHUB_WORKSPACE/fud/filament.py filament | |
| fud config stages.filament.exec $GITHUB_WORKSPACE/target/debug/filament | |
| fud config stages.filament.library $GITHUB_WORKSPACE | |
| - name: Build Filament | |
| run: | | |
| cargo build --all | |
| - name: Check versions | |
| run: | | |
| rustc --version | |
| cargo --version | |
| - name: Original test suite | |
| run: | |
| runt -d -o fail -j 1 --max-futures 10 |