Skip to content

Commit

Permalink
Move to separate file qns.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
mxinden committed Jan 16, 2024
1 parent 6677bcb commit be2d481
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 47 deletions.
47 changes: 0 additions & 47 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,50 +128,3 @@ jobs:
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}

qns-docker-image: # Docker image for QUIC network simulator i.e. interop runner (https://github.com/quic-interop/quic-interop-runner)
needs: check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Extract Rust version
id: rust-version
run: |
RUST_VERSION=$(grep -m1 'rust-version' neqo-common/Cargo.toml | cut -d '"' -f 2)
echo "::set-output name=version::$RUST_VERSION"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}-qns
tags: |
# default
type=schedule
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
# set latest tag for default branch
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push
uses: docker/build-push-action@v5
with:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
file: qns/Dockerfile
build-args: |
RUST_VERSION=${{ steps.rust-version.outputs.version }}
cache-from: type=gha
cache-to: type=gha,mode=max
57 changes: 57 additions & 0 deletions .github/workflows/qns.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: qns # (quic-network-simulator)

on:
push:
branches: ["main", "docker"] # TODO: remove docker
paths-ignore: ["*.md", "*.png", "*.svg", "LICENSE-*"]
pull_request:
branches: ["main"]
paths-ignore: ["*.md", "*.png", "*.svg", "LICENSE-*"]

jobs:
docker-image:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Extract Rust version
id: rust-version
run: |
RUST_VERSION=$(grep -m1 'rust-version' neqo-common/Cargo.toml | cut -d '"' -f 2)
echo "::set-output name=version::$RUST_VERSION"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}-qns
tags: |
# default
type=schedule
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
# set latest tag for default branch
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push
uses: docker/build-push-action@v5
with:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
file: qns/Dockerfile
build-args: |
RUST_VERSION=${{ steps.rust-version.outputs.version }}
cache-from: type=gha
cache-to: type=gha,mode=max

0 comments on commit be2d481

Please sign in to comment.