run-test-shell #663
This file contains 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: run-test-shell | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: | |
- master | |
schedule: | |
- cron: '0 10 * * *' | |
jobs: | |
main: | |
name: Test image | |
# Only run schedule for the main repository - not forks | |
if: ${{ github.event_name != 'schedule' || github.repository == 'dlang-tour/core-exec' }} | |
strategy: | |
fail-fast: true | |
matrix: | |
include: | |
- { version: dmd-nightly, exec: dmd } | |
- { version: dmd-beta, exec: dmd } | |
- { version: dmd, exec: dmd } | |
- { version: ldc-beta, exec: ldmd2 } | |
- { version: ldc, exec: ldmd2 } | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to DockerHub | |
if: ${{ github.event_name == 'push' || github.event_name == 'schedule' }} | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_TOKEN }} | |
- name: Build image | |
uses: docker/build-push-action@v4 | |
with: | |
push: false | |
load: true | |
tags: dlangtour/core-exec:${{ matrix.version }} | |
build-args: | | |
DLANG_VERSION=${{ matrix.version }} | |
DLANG_EXEC=${{ matrix.exec }} | |
- name: Test image | |
run: ./test.sh "dlangtour/core-exec:${{ matrix.version }}" | |
- name: Push image | |
uses: docker/build-push-action@v4 | |
with: | |
push: ${{ github.event_name == 'push' || github.event_name == 'schedule' }} | |
load: false | |
tags: dlangtour/core-exec:${{ matrix.version }} | |
build-args: | | |
DLANG_VERSION=${{ matrix.version }} | |
DLANG_EXEC=${{ matrix.exec }} | |