Skip to content

[ci/wasm] Try using devcontainers #28

[ci/wasm] Try using devcontainers

[ci/wasm] Try using devcontainers #28

Workflow file for this run

name: Build WebAssembly of fotowall
on:
push:
paths-ignore:
# Changes to those files don't mandate running CI
- ".github/workflows/package.yml"
- ".github/workflows/build.yml"
- "debian/**"
- "README.md"
- "doc/**"
- ".pre-commit-config.yaml"
branches:
- '**'
pull_request:
branches:
- '**'
jobs:
build-webassembly:
strategy:
fail-fast: false
matrix:
os: ["ubuntu_22.04"]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
# - name: Build within Docker
# run: |
# echo "::group::Setup Dockerfile"
# mkdir -p /tmp/fotowall-docker
# cp -r `pwd` /tmp/fotowall-docker/source
# cp docker-emscripten/Dockerfile /tmp/fotowall-docker/Dockerfile
# cd /tmp/fotowall-docker
# echo "::endgroup::"
# echo "::group::Dockerfile used to build fotowall webassembly with emscripten"
# cat Dockerfile
# echo "::endgroup::"
# echo "::group::Build base image"
# docker build -t fotowall-ci-${{matrix.os}} .
# echo "::endgroup::"
# echo "::group::Build within docker"
# docker run --rm -v "/tmp/fotowall-docker/source:/src/" -u $(id -u):$(id -g) fotowall-ci-${{matrix.os}} 'mkdir /src/build; cd /src/build; cmake -GNinja .. && ninja'
# echo "::endgroup::"
# echo "::group::Create fotowall-webassembly.tar.gz archive"
# ls /tmp/fotowall-docker/source/build
# cd /tmp/fotowall-docker/source/build
# mkdir fotowall-webassembly
# cp fotowall.js fotowall.html fotowall.wasm qtloader.js qtlogo.svg fotowall-webassembly
# tar -czf fotowall-webassembly.tar.gz fotowall-webassembly
# cp -r fotowall-webassembly /home/runner/work/fotowall/fotowall
# echo "::endgroup::"
- name: Pre-build image and run make ci-build in dev container
uses: devcontainers/[email protected]
with:
imageName: qt6-emscripten
configFile: ./.devcontainer/qt6-emscripten/devcontainer.json
runCmd: mkdir build && cd build && cmake -GNinja .. && ninja
- name: Show results
run: |
ls $GITHUB_WORKSPACE
# - name: Push WebAssembly to Cloudsmith
# id: push
# # if: github.ref == 'refs/heads/master' && github.repository == 'fotowall/fotowall'
# uses: cloudsmith-io/action@master
# with:
# api-key: ${{ secrets.CLOUDSMITH_API_KEY }}
# command: "push"
# format: "raw"
# owner: "arntanguy"
# repo: "head"
# file: "/tmp/fotowall-docker/source/build/fotowall-webassembly.tar.gz"
# tags: "latest"
# name: "fotowall-webassembly-latest.tar.gz"
# summary: "Upload latest webassembly build"
# description: "See https://github.com/cloudsmith-io/action"
# version: ${{ github.sha}}
# - name: Deploy to gh-pages 🚀
# uses: JamesIves/github-pages-deploy-action@v4
# with:
# folder: /tmp/fotowall-docker/source/build/fotowall-webassembly # The folder the action should deploy.