Merge branch 'default' into fix-caching

This commit is contained in:
Renée Kooi 2024-04-26 09:37:40 +02:00
commit ddee30a84b
13 changed files with 4276 additions and 3204 deletions

View File

@ -6,3 +6,9 @@ updates:
interval: daily
time: "04:00"
open-pull-requests-limit: 10
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
time: "04:00"
open-pull-requests-limit: 10

View File

@ -9,13 +9,9 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: npm install
- uses: EndBug/add-and-commit@v4
- uses: EndBug/add-and-commit@v9
with:
add: dist
message: Rebuild
author_name: Automated
author_email: github@asdf.kooi.me
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
message: Rebuild (automated)

View File

@ -6,7 +6,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install dependencies
run: npm install
- name: Run tests
@ -18,18 +18,23 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
zig-version: [0.7.0, 0.8.0, 0.9.0, 0.10.0]
zig-version: [0.7.0, 0.8.0, 0.9.0, 0.10.0, 0.11.0]
include:
- os: ubuntu-latest
zig-version: 0.5.0
runs-on: ${{matrix.os}}
steps:
- name: Checkout sources
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install Zig
uses: goto-bus-stop/setup-zig@default
with:
version: ${{matrix.zig-version}}
- name: Run tests
- name: Run tests (zig up to v0.10.x)
if: ${{ !startsWith(matrix.zig-version, '0.11.') }}
run: zig build test
working-directory: test
working-directory: test/v0.10
- name: Run tests (zig v0.11.x)
if: ${{ startsWith(matrix.zig-version, '0.11.') }}
run: zig build test
working-directory: test/v0.11

2
.gitignore vendored
View File

@ -1,3 +1,5 @@
node_modules
# Logs
logs
*.log

View File

@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
## 2.2.0
* Update the action to use Node.js 20. [#61](https://github.com/goto-bus-stop/setup-zig/pull/61)
* Add a test for zig 0.11.0. [#62](https://github.com/goto-bus-stop/setup-zig/pull/62)
Thanks [@chenrui333](https://github.com/chenrui333)!
## 2.1.1
* Fix `cache: false`, see [#55](https://github.com/goto-bus-stop/setup-zig/issues/55).

View File

@ -24,7 +24,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: goto-bus-stop/setup-zig@v2
- run: zig fmt --check src/*.zig
- run: zig fmt --check .
```
Optionally set a Zig version:

View File

@ -14,5 +14,5 @@ inputs:
required: false
default: 'true'
runs:
using: 'node16'
using: 'node20'
main: 'dist/index.js'

7187
dist/index.js vendored

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
{
"name": "setup-zig",
"description": "Use the zig compiler in your Github Action",
"version": "2.1.1",
"version": "2.2.0",
"author": "Renée Kooi <renee@kooi.me>",
"bugs": {
"url": "https://github.com/goto-bus-stop/setup-zig/issues"
@ -14,7 +14,7 @@
"simple-get": "^4.0.0"
},
"devDependencies": {
"esbuild": "^0.19.0",
"esbuild": "^0.20.0",
"standard": "^17.0.0"
},
"homepage": "https://github.com/goto-bus-stop/setup-zig",
@ -31,7 +31,7 @@
"url": "https://github.com/goto-bus-stop/setup-zig.git"
},
"scripts": {
"prepare": "esbuild index.js --outdir=dist --keep-names --bundle --platform=node --target=node16",
"prepare": "esbuild index.js --outdir=dist --keep-names --bundle --platform=node --target=node20",
"test": "standard && node test"
},
"standard": {

13
test/v0.11/build.zig Normal file
View File

@ -0,0 +1,13 @@
const Build = @import("std").Build;
pub fn build(b: *Build) void {
const optimize = b.standardOptimizeOption(.{});
const test_build = b.addTest(.{
.root_source_file = .{ .path = "src/main.zig" },
.optimize = optimize,
});
const run_test = b.addRunArtifact(test_build);
const test_step = b.step("test", "Run the app");
test_step.dependOn(&run_test.step);
}

5
test/v0.11/src/main.zig Normal file
View File

@ -0,0 +1,5 @@
const debug = @import("std").debug;
test "it works" {
debug.assert(1 == 1);
}