Skip to content

Commit

Permalink
ci: Ensure devcontainer is pushing correctly (#3682)
Browse files Browse the repository at this point in the history
  • Loading branch information
max-sixty authored Oct 15, 2023
1 parent f3a750e commit 1ccb70d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -263,4 +263,6 @@ jobs:
if: github.event_name == 'release'
uses: ./.github/workflows/build-devcontainer.yaml
with:
# TOOD: I think having this as a bool is OK, but check a recent release
# from 0.10.0 and confirm that it is indeed pushing the image.
push: true
24 changes: 18 additions & 6 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
book: ${{ steps.changes.outputs.book }}
dotnet: ${{ steps.changes.outputs.dotnet }}
devcontainer-push: ${{ steps.devcontainer-push.outputs.run }}
devcontainer-test: ${{ steps.changes.outputs.devcontainer-test }}
devcontainer-build: ${{ steps.devcontainer-build.outputs.run }}
elixir: ${{ steps.changes.outputs.elixir }}
grammars: ${{ steps.changes.outputs.grammars }}
java: ${{ steps.changes.outputs.java }}
Expand Down Expand Up @@ -75,7 +75,7 @@ jobs:
devcontainer-push:
- .devcontainer/**/*Dockerfile
- Taskfile.yml
devcontainer-test:
devcontainer-build:
- .devcontainer/**/*Dockerfile
- .github/workflows/build-devcontainer.yaml
- Taskfile.yml
Expand Down Expand Up @@ -153,6 +153,13 @@ jobs:
github.ref == 'refs/heads/main' && github.event_name == 'push' }}" >>
"$GITHUB_OUTPUT"

- id: devcontainer-build
run:
echo "run=${{ steps.devcontainer-push.outputs.run == 'true' ||
steps.changes.outputs.devcontainer-build == 'true' ||
steps.changes.outputs.nightly-schedule == 'true' }}" >>
"$GITHUB_OUTPUT"

test-rust:
needs: rules
if: needs.rules.outputs.rust == 'true' || needs.rules.outputs.main == 'true'
Expand Down Expand Up @@ -439,12 +446,17 @@ jobs:

build-devcontainer:
needs: rules
if:
${{ needs.rules.outputs.devcontainer-test == 'true' ||
needs.rules.outputs.nightly-schedule == 'true' }}
if: needs.rules.outputs.devcontainer-build == 'true'
uses: ./.github/workflows/build-devcontainer.yaml
# One problem with this setup is that if another commit is merged to main,
# this workflow will cancel existing jobs, and so this won't get pushed. We
# have another workflow which runs on each release, so the image should get
# pushed eventually. The alternative is to have a separate workflow, but
# then we can't use the nice logic of when to run the workflow that we've
# built up here.
with:
push: ${{ needs.rules.outputs.devcontainer-push }}
# This needs to compare to the string `'true'`, because of GHA awkwardness
push: ${{ needs.rules.outputs.devcontainer-push == 'true' }}

time-compilation:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 1ccb70d

Please sign in to comment.