Update rustls-webpki because of security risk. #770
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: Build Docker images | |
| on: | |
| push: | |
| tags: | |
| - '*' | |
| branches: | |
| - '*' | |
| jobs: | |
| build-docker: | |
| name: Build Docker image | |
| runs-on: ubuntu-latest | |
| permissions: | |
| packages: write | |
| contents: read | |
| steps: | |
| - name: Checkout sources | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Create version tag | |
| shell: bash | |
| run: echo "tag=ghcr.io/openleadr/openleadr-rs:$(git show -s --format="%ct-%h" $GITHUB_SHA)" >> $GITHUB_ENV | |
| - name: "'main' tag on main branch" | |
| if: github.ref == 'refs/heads/main' | |
| run: echo "tag=${{ env.tag }},ghcr.io/openleadr/openleadr-rs:main" >> $GITHUB_ENV | |
| - name: "explicit release tags & 'latest' tag" | |
| if: github.ref_type == 'tag' | |
| run: | | |
| REF_NAME=${{ github.ref_name }} | |
| TAGS="${{ env.tag }},ghcr.io/openleadr/openleadr-rs:${REF_NAME}" | |
| if [[ $REF_NAME =~ ^v?[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | |
| echo "Stable release detected. Adding 'latest' tag." | |
| TAGS="${TAGS},ghcr.io/openleadr/openleadr-rs:latest" | |
| else | |
| echo "Pre-release or non-standard tag detected. Skipping 'latest'." | |
| fi | |
| echo "tag=${TAGS}" >> $GITHUB_ENV | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0 | |
| - name: Build Docker image | |
| uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0 | |
| with: | |
| context: . | |
| file: ./vtn.Dockerfile | |
| tags: "${{ env.tag }}" | |
| push: true | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| elaad-tests: | |
| name: Run ElaadNL Tests | |
| needs: build-docker | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: read | |
| steps: | |
| - name: Get docker build information | |
| uses: actions/download-artifact@v8 | |
| id: download_docker_images | |
| with: | |
| pattern: '*.dockerbuild' | |
| - name: Extract docker image SHA | |
| run: | | |
| gunzip ${{ steps.download_docker_images.outputs.download-path }}/*.dockerbuild --suffix .dockerbuild | |
| tar -xf OpenLEADR~openleadr-rs* | |
| echo sha=$(cat index.json | jq .manifests[0].digest -r) >> $GITHUB_ENV | |
| - name: Checkout ElaadNL openadr3-client | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: 'ElaadNL/openadr3-client' | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| - name: Set up Python | |
| run: uv python install | |
| - id: install_dependencies | |
| name: Install dependencies | |
| run: uv sync --locked --all-extras --dev | |
| - id: run_tests | |
| name: Run tests | |
| run: uv run pytest tests/oadr310/vtn --ignore=tests/oadr310/vtn/mqtt --openleadr-310-version=${{ env.sha }} | |
| continue-on-error: true | |
| - name: Print test outcome | |
| run: | | |
| if [ "${{ steps.run_tests.outcome }}" == "failure" ]; then | |
| echo "## :heavy_exclamation_mark: ElaadNL tests failed :x:" >> $GITHUB_STEP_SUMMARY | |
| echo "This might be due to incompatible changes in either the EladdNL test suite or OpenLEADR" >> $GITHUB_STEP_SUMMARY | |
| else | |
| echo "## Tests passed :white_check_mark:" >> $GITHUB_STEP_SUMMARY | |
| fi |