Skip to content

Commit

Permalink
add ci configuration with github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
lilioid committed Mar 25, 2024
1 parent 1ed592b commit 2a394ba
Show file tree
Hide file tree
Showing 12 changed files with 73 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
rustflags = ["--cfg", "tokio_unstable", "-C", "target-cpu=native"]

[target.aarch64-unknown-linux-gnu]
linker = "aarch64-linux-gnu-gcc"
linker = "aarch64-linux-gnu-gcc"
34 changes: 34 additions & 0 deletions .github/workflows/container.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: container
on:
push: {}
workflow_dispatch: {}
schedule:
- cron: "0 3 * * MON"

permissions:
contents: read
packages: write

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true

jobs:
build-container-image:
runs-on: ubuntu-latest
steps:
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- uses: docker/build-push-action@v5
with:
push: ${{ github.ref_name == 'main' }}
tags: |
ghcr.io/${{ github.repository }}:latest
labels: |
org.opencontainers.image.title=${{ github.repository }}
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
org.opencontainers.image.revision=${{ github.sha }}
31 changes: 31 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: test
on:
schedule:
- cron: "* 3 * * MON"
workflow_dispatch:
push:
branches: [ "*" ]

jobs:
check-pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.11
- run: python -m pip install pre-commit
- uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
- run: pre-commit run --show-diff-on-failure --color=always --all-files

test-pixelflut:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly
- run: cargo test --all-features
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@
**/*.pixmap
**/*.pxmap
target/

2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ repos:
name: rust check
types: [ rust ]
language: system
entry: cargo check --all-targets --all-features
entry: cargo check --all-features
pass_filenames: false
1 change: 0 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# pixelflut
> A pixel drawing game for programmers
Pixelflut provides a 2D pixel canvas upon which many people can competitively set single color values.
Pixelflut provides a 2D pixel canvas upon which many people can competitively set single color values.
It is inspired by Reddits [r/place](https://www.reddit.com/r/place) and [CCCGOE's Pixelflut](https://cccgoe.de/wiki/Pixelflut).

![Screenshot](.screenshot.png)
Expand Down Expand Up @@ -30,7 +30,7 @@ cargo install --git=https://github.com/ftsell/pixelflut.git --features=default,b
```

- Start a pixelflut tcp server on port 1234 with default size and persisted in the file *~/pixmap.pixmap*

```bash
pixelflut server --file ~/pixmap.pixmap --tcp 1234
```
Expand All @@ -40,4 +40,3 @@ cargo install --git=https://github.com/ftsell/pixelflut.git --features=default,b
```bash
pixelflut server --file ~/pixmap.pixmap --udp 1234 --width 10 --height 20
```

1 change: 0 additions & 1 deletion k8s/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,3 @@ spec:
volumeMounts:
- mountPath: /app/data
name: data

2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[toolchain]
channel = "nightly"
channel = "nightly"
2 changes: 1 addition & 1 deletion rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
max_width = 110
max_width = 110
2 changes: 1 addition & 1 deletion scripts/ws_test.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
}
</script>
</body>
</html>
</html>
2 changes: 1 addition & 1 deletion src/net/clients/gen_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use async_trait::async_trait;
use std::net::SocketAddr;

/// A trait to unify the different transport protocol clients
///
///
/// Most clients are implemented for convenience and not for high-performance.
/// If you care about performance and need high control about buffering and write scheduling,
/// it is recommended to implement your own client.
Expand Down

0 comments on commit 2a394ba

Please sign in to comment.