Skip to content

Commit

Permalink
Build docker image in gh actions
Browse files Browse the repository at this point in the history
  • Loading branch information
owickstrom committed Nov 5, 2022
1 parent ec3d6f4 commit 8aba39c
Show file tree
Hide file tree
Showing 3 changed files with 122 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: owickstrom
32 changes: 32 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: Bug report
about: Create a report to help us improve
---

This issue tracker is **ONLY** used for reporting bugs.

Feature requests, questions, and other discussions should be posted in the
[Discussions](https://github.com/quickstrom/quickstrom/discussions) forum.

**Describe the bug**
A clear and concise description of what the bug is.

**To reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen. Include
screenshots, logs or stack traces if applicable.

**Environment (please complete the following information):**
- OS: [e.g. Ubuntu 18.04, macOS 10.10]
- Quickstrom version or commit [e.g. 0.1.0]
- Browser and webdriver information: [e.g. Firefox 86.0 and Geckodriver 0.29.1]
- Build environment or installation method [e.g. Nix, Cabal, Docker]

**Additional context**
Add any other context about the problem here.
89 changes: 89 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: "Build and test"
on:
pull_request:
push:
jobs:

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.1
- uses: cachix/install-nix-action@v12
with:
nix_path: nixpkgs=channel:nixos-unstable
extra_nix_config: |
experimental-features = nix-command
- uses: cachix/cachix-action@v8
with:
name: quickstrom
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
- run: nix show-config
- run: nix-env -f '<nixpkgs>' -i nix-build-uncached
- run: |
version=$(nix-shell -p yj --command "yj -tj < pyproject.toml | jq -r '.tool.poetry.version'")
echo "version=$version" >> $GITHUB_ENV
echo "Version: $version"
- run: nix-build-uncached default.nix

integration-tests:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
browser:
- chrome
steps:
- uses: actions/checkout@v2.3.1
- uses: cachix/install-nix-action@v12
with:
nix_path: nixpkgs=channel:nixos-unstable
extra_nix_config: |
experimental-features = nix-command
- uses: cachix/cachix-action@v8
with:
name: quickstrom
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
- run: nix show-config
- run: nix-env -f '<nixpkgs>' -i nix-build-uncached
- run: nix build -L -j1 --option sandbox relaxed --argstr browser ${{matrix.browser}} -f integration-tests/default.nix

build-docker:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.1
- uses: cachix/install-nix-action@v12
with:
nix_path: nixpkgs=channel:nixos-unstable
extra_nix_config: |
experimental-features = nix-command
- uses: cachix/cachix-action@v8
with:
name: quickstrom
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
- run: docker login --username botstrom --password "$DOCKER_HUB_ACCESS_TOKEN"
if: github.ref == 'refs/heads/main'
env:
DOCKER_HUB_ACCESS_TOKEN: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- run: docker load -i $(nix-build -A docker default.nix)
- run: |
docker tag quickstrom/quickstrom:latest quickstrom/quickstrom:${{ env.version }}
docker push quickstrom/quickstrom:latest
docker push quickstrom/quickstrom:${{ env.version }}
if: github.ref == 'refs/heads/main'
lint-docs:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.1
- uses: cachix/install-nix-action@v12
with:
nix_path: nixpkgs=channel:nixos-unstable
extra_nix_config: |
experimental-features = nix-command
- uses: cachix/cachix-action@v8
with:
name: quickstrom
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
- run: nix-build docs/default.nix

0 comments on commit 8aba39c

Please sign in to comment.